Changeset 6476c0e for owl.c


Ignore:
Timestamp:
May 25, 2011, 11:05:32 PM (13 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
6eb3ed9, 414a272
Parents:
697221f
git-author:
Anders Kaseorg <andersk@mit.edu> (05/25/11 23:02:56)
git-committer:
Anders Kaseorg <andersk@mit.edu> (05/25/11 23:05:32)
Message:
stderr_redirect_handler: Handle partial or failed reads

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.c

    rf97c1a6 r6476c0e  
    464464  }
    465465  bread = read(rfd, buf, navail);
    466   if (buf[navail-1] != '\0') {
    467     buf[navail] = '\0';
    468   }
    469 
    470   err = g_strdup_printf("[stderr]\n%s", buf);
     466  if (bread == -1)
     467    return;
     468
     469  err = g_strdup_printf("[stderr]\n%.*s", bread, buf);
    471470
    472471  owl_function_log_err(err);
Note: See TracChangeset for help on using the changeset viewer.