shut up some gcc warn_unused_result thingies from Fedora
This commit is contained in:
parent
1b7294b564
commit
ccb41ecb4d
21
histrap.c
21
histrap.c
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#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];
|
Trap sigtraps[NSIG + 1];
|
||||||
static struct sigaction Sigact_ign;
|
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);
|
shf_snprintf(nfile, sizeof(nfile), "%s.%d", hname, (int)procpid);
|
||||||
if ((fd = open(nfile, O_CREAT | O_TRUNC | O_WRONLY, 0600)) < 0)
|
if ((fd = open(nfile, O_CREAT | O_TRUNC | O_WRONLY, 0600)) < 0)
|
||||||
return 1;
|
return 1;
|
||||||
if (fstat(histfd, &statb) >= 0)
|
if (fstat(histfd, &statb) >= 0 &&
|
||||||
chown(nfile, statb.st_uid, statb.st_gid);
|
chown(nfile, statb.st_uid, statb.st_gid))
|
||||||
|
goto errout;
|
||||||
|
|
||||||
if (sprinkle(fd)) {
|
if (sprinkle(fd) || write(fd, nbase, nbytes) != nbytes) {
|
||||||
close(fd);
|
errout:
|
||||||
unlink(nfile);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (write(fd, nbase, nbytes) != nbytes) {
|
|
||||||
close(fd);
|
close(fd);
|
||||||
unlink(nfile);
|
unlink(nfile);
|
||||||
return 1;
|
return 1;
|
||||||
@ -919,8 +916,10 @@ writehistfile(int lno, char *cmd)
|
|||||||
hdr[2] = (lno>>16)&0xff;
|
hdr[2] = (lno>>16)&0xff;
|
||||||
hdr[3] = (lno>>8)&0xff;
|
hdr[3] = (lno>>8)&0xff;
|
||||||
hdr[4] = lno&0xff;
|
hdr[4] = lno&0xff;
|
||||||
(void) write(histfd, hdr, 5);
|
bytes = strlen(cmd) + 1;
|
||||||
(void) write(histfd, cmd, strlen(cmd)+1);
|
if ((write(histfd, hdr, 5) != 5) ||
|
||||||
|
(write(histfd, cmd, bytes) != bytes))
|
||||||
|
goto bad;
|
||||||
hsize = lseek(histfd, 0L, SEEK_END);
|
hsize = lseek(histfd, 0L, SEEK_END);
|
||||||
(void) flock(histfd, LOCK_UN);
|
(void) flock(histfd, LOCK_UN);
|
||||||
return;
|
return;
|
||||||
|
4
jobs.c
4
jobs.c
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "sh.h"
|
#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! */
|
/* Order important! */
|
||||||
#define PRUNNING 0
|
#define PRUNNING 0
|
||||||
@ -411,7 +411,7 @@ exchild(struct op *t, int flags,
|
|||||||
SS_RESTORE_DFL|SS_FORCE);
|
SS_RESTORE_DFL|SS_FORCE);
|
||||||
}
|
}
|
||||||
if (Flag(FBGNICE) && (flags & XBGND))
|
if (Flag(FBGNICE) && (flags & XBGND))
|
||||||
nice(4);
|
i = nice(4);
|
||||||
if ((flags & XBGND) && !Flag(FMONITOR)) {
|
if ((flags & XBGND) && !Flag(FMONITOR)) {
|
||||||
setsig(&sigtraps[SIGINT], SIG_IGN,
|
setsig(&sigtraps[SIGINT], SIG_IGN,
|
||||||
SS_RESTORE_IGN|SS_FORCE);
|
SS_RESTORE_IGN|SS_FORCE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user