shut up some gcc warn_unused_result thingies from Fedora

This commit is contained in:
tg 2007-09-09 19:12:10 +00:00
parent 1b7294b564
commit ccb41ecb4d
2 changed files with 12 additions and 13 deletions

View File

@ -3,7 +3,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.55 2007/08/20 14:12:29 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.56 2007/09/09 19:12:09 tg Exp $");
Trap sigtraps[NSIG + 1];
static struct sigaction Sigact_ign;
@ -749,15 +749,12 @@ hist_shrink(unsigned char *oldbase, int oldbytes)
shf_snprintf(nfile, sizeof(nfile), "%s.%d", hname, (int)procpid);
if ((fd = open(nfile, O_CREAT | O_TRUNC | O_WRONLY, 0600)) < 0)
return 1;
if (fstat(histfd, &statb) >= 0)
chown(nfile, statb.st_uid, statb.st_gid);
if (fstat(histfd, &statb) >= 0 &&
chown(nfile, statb.st_uid, statb.st_gid))
goto errout;
if (sprinkle(fd)) {
close(fd);
unlink(nfile);
return 1;
}
if (write(fd, nbase, nbytes) != nbytes) {
if (sprinkle(fd) || write(fd, nbase, nbytes) != nbytes) {
errout:
close(fd);
unlink(nfile);
return 1;
@ -919,8 +916,10 @@ writehistfile(int lno, char *cmd)
hdr[2] = (lno>>16)&0xff;
hdr[3] = (lno>>8)&0xff;
hdr[4] = lno&0xff;
(void) write(histfd, hdr, 5);
(void) write(histfd, cmd, strlen(cmd)+1);
bytes = strlen(cmd) + 1;
if ((write(histfd, hdr, 5) != 5) ||
(write(histfd, cmd, bytes) != bytes))
goto bad;
hsize = lseek(histfd, 0L, SEEK_END);
(void) flock(histfd, LOCK_UN);
return;

4
jobs.c
View File

@ -2,7 +2,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.27 2007/09/09 18:06:41 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.28 2007/09/09 19:12:10 tg Exp $");
/* Order important! */
#define PRUNNING 0
@ -411,7 +411,7 @@ exchild(struct op *t, int flags,
SS_RESTORE_DFL|SS_FORCE);
}
if (Flag(FBGNICE) && (flags & XBGND))
nice(4);
i = nice(4);
if ((flags & XBGND) && !Flag(FMONITOR)) {
setsig(&sigtraps[SIGINT], SIG_IGN,
SS_RESTORE_IGN|SS_FORCE);