X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/19bf8698eeb0ab3d7694232af115fa3f007d5c7b..215f8df2be496a67942590ab2aefdad5b182fe25:/uip/dropsbr.c diff --git a/uip/dropsbr.c b/uip/dropsbr.c index 915e71e6..dee95fe7 100644 --- a/uip/dropsbr.c +++ b/uip/dropsbr.c @@ -80,8 +80,12 @@ mbx_open (char *file, int mbx_style, uid_t uid, gid_t gid, mode_t mode) * The stat failed. So we make sure file * has right ownership/modes */ - chown (file, uid, gid); - chmod (file, mode); + if (chown (file, uid, gid) < 0) { + advise (file, "chown"); + } + if (chmod (file, mode) < 0) { + advise (file, "chmod"); + } } else if (st.st_size > (off_t) 0) { int status; @@ -396,7 +400,9 @@ mbx_copy (char *mailbox, int mbx_style, int md, int fd, * "From ", then prepend line with ">". */ if (j != 0 && strncmp (buffer, "From ", 5) == 0) { - write (md, ">", 1); + if (write (md, ">", 1) < 0) { + advise (mailbox, "write"); + } size++; } i = strlen (buffer);