sig_unblock(sig_term);
sig_unblock(sig_alarm);
sig_unblock(sig_hangup);
-
+
if (verbose)
bb_error_msg(INFO"processing: %s/%s", ld->name, ld->fnsave);
fd = xopen(ld->fnsave, O_RDONLY|O_NDELAY);
if (fd_move(0, fd) == -1)
bb_perror_msg_and_die(FATAL"cannot %s processor %s", "move filedescriptor for", ld->name);
ld->fnsave[26] = 't';
- fd = xopen3(ld->fnsave, O_WRONLY|O_NDELAY|O_TRUNC|O_CREAT, 0644);
+ fd = xopen(ld->fnsave, O_WRONLY|O_NDELAY|O_TRUNC|O_CREAT);
if (fd_move(1, fd) == -1)
bb_perror_msg_and_die(FATAL"cannot %s processor %s", "move filedescriptor for", ld->name);
fd = open_read("state");
if (fd == -1) {
if (errno != ENOENT)
bb_perror_msg_and_die(FATAL"cannot %s processor %s", "open state for", ld->name);
- close(xopen3("state", O_WRONLY|O_NDELAY|O_TRUNC|O_CREAT, 0644));
+ close(xopen("state", O_WRONLY|O_NDELAY|O_TRUNC|O_CREAT));
fd = xopen("state", O_RDONLY|O_NDELAY);
}
if (fd_move(4, fd) == -1)
bb_perror_msg_and_die(FATAL"cannot %s processor %s", "move filedescriptor for", ld->name);
- fd = xopen3("newstate", O_WRONLY|O_NDELAY|O_TRUNC|O_CREAT, 0644);
+ fd = xopen("newstate", O_WRONLY|O_NDELAY|O_TRUNC|O_CREAT);
if (fd_move(5, fd) == -1)
bb_perror_msg_and_die(FATAL"cannot %s processor %s", "move filedescriptor for", ld->name);
return 0;
}
if (ld->ppid)
- while(!processorstop(ld))
+ while (!processorstop(ld))
/* wait */;
while (fchdir(ld->fddir) == -1)
coe(ld->fdcur);
while (fchmod(ld->fdcur, 0644) == -1)
pause2cannot("set mode of current", ld->name);
-
+
if (verbose) {
if (i == 0) bb_error_msg(INFO"append: %s/current", ld->name);
else bb_error_msg(INFO"new: %s/current", ld->name);
}
-
+
while (fchdir(fdwdir) == -1)
pause1cannot("change to initial working directory");
return 1;
tmaxflag = 0;
taia_now(&now);
for (l = 0; l < dirn; ++l) {
- logdir_close(&dir[l]);
+ logdir_close(&dir[l]);
if (logdir_open(&dir[l], fndir[l])) ok = 1;
}
if (!ok) fatalx("no functional log directories");
if (ld->fddir == -1) continue;
if (ld->inst)
logmatch(ld);
- if (ld->matcherr == 'e') {
- fprintf(stderr, "%.*s%s",
- printlen, line,
- (ch != '\n') ? "...\n" : ""
- );
- }
+ if (ld->matcherr == 'e')
+ full_write(2, line, printlen);
if (ld->match != '+') continue;
buffer_pwrite(i, line, printlen);
}
/* linelen == no of chars incl. '\n' (or == stdin_cnt) */
for (i = 0; i < dirn; ++i) {
if (dir[i].fddir == -1) continue;
+ if (dir[i].matcherr == 'e')
+ full_write(2, lineptr, linelen);
if (dir[i].match != '+') continue;
buffer_pwrite(i, lineptr, linelen);
}