Trailing whitespace removal over entire tree
This commit is contained in:
@@ -290,7 +290,7 @@ int chpst_main(int argc, char **argv)
|
||||
}
|
||||
argv += optind;
|
||||
if (!argv || !*argv) bb_show_usage();
|
||||
|
||||
|
||||
if (OPT_pgrp) setsid();
|
||||
if (env_dir) edir(env_dir);
|
||||
if (root) {
|
||||
|
||||
@@ -84,7 +84,7 @@ int buffer_feed(buffer *s)
|
||||
int buffer_bget(buffer *s,char *buf,unsigned len)
|
||||
{
|
||||
int r;
|
||||
|
||||
|
||||
if (s->p > 0) return getthis(s,buf,len);
|
||||
if (s->n <= len) return oneread(s->op,s->fd,buf,s->n);
|
||||
r = buffer_feed(s); if (r <= 0) return r;
|
||||
@@ -94,7 +94,7 @@ int buffer_bget(buffer *s,char *buf,unsigned len)
|
||||
int buffer_get(buffer *s,char *buf,unsigned len)
|
||||
{
|
||||
int r;
|
||||
|
||||
|
||||
if (s->p > 0) return getthis(s,buf,len);
|
||||
if (s->n <= len) return oneread(s->op,s->fd,buf,len);
|
||||
r = buffer_feed(s); if (r <= 0) return r;
|
||||
@@ -135,7 +135,7 @@ static int allwrite(int (*op)(int fd,char *buf,unsigned len),int fd,const char *
|
||||
int buffer_flush(buffer *s)
|
||||
{
|
||||
int p;
|
||||
|
||||
|
||||
p = s->p;
|
||||
if (!p) return 0;
|
||||
s->p = 0;
|
||||
@@ -145,7 +145,7 @@ int buffer_flush(buffer *s)
|
||||
int buffer_putalign(buffer *s,const char *buf,unsigned len)
|
||||
{
|
||||
unsigned n;
|
||||
|
||||
|
||||
while (len > (n = s->n - s->p)) {
|
||||
memcpy(s->x + s->p,buf,n);
|
||||
s->p += n;
|
||||
@@ -162,7 +162,7 @@ int buffer_putalign(buffer *s,const char *buf,unsigned len)
|
||||
int buffer_put(buffer *s,const char *buf,unsigned len)
|
||||
{
|
||||
unsigned n;
|
||||
|
||||
|
||||
n = s->n;
|
||||
if (len > n - s->p) {
|
||||
if (buffer_flush(s) == -1) return -1;
|
||||
@@ -487,7 +487,7 @@ void taia_sub(struct taia *t,const struct taia *u,const struct taia *v)
|
||||
{
|
||||
unsigned long unano = u->nano;
|
||||
unsigned long uatto = u->atto;
|
||||
|
||||
|
||||
t->sec.x = u->sec.x - v->sec.x;
|
||||
t->nano = unano - v->nano;
|
||||
t->atto = uatto - v->atto;
|
||||
|
||||
@@ -300,7 +300,7 @@ static void startservice(struct svdir *s)
|
||||
fatal_cannot("setup filedescriptor for ./log/run");
|
||||
close(logpipe[1]);
|
||||
if (chdir("./log") == -1)
|
||||
fatal_cannot("change directory to ./log");
|
||||
fatal_cannot("change directory to ./log");
|
||||
} else {
|
||||
if (fd_copy(1, logpipe[1]) == -1)
|
||||
fatal_cannot("setup filedescriptor for ./run");
|
||||
@@ -405,7 +405,7 @@ int runsv_main(int argc, char **argv)
|
||||
coe(selfpipe[1]);
|
||||
ndelay_on(selfpipe[0]);
|
||||
ndelay_on(selfpipe[1]);
|
||||
|
||||
|
||||
sig_block(sig_child);
|
||||
sig_catch(sig_child, s_child);
|
||||
sig_block(sig_term);
|
||||
@@ -544,7 +544,7 @@ int runsv_main(int argc, char **argv)
|
||||
for (;;) {
|
||||
int child;
|
||||
int wstat;
|
||||
|
||||
|
||||
child = wait_nohang(&wstat);
|
||||
if (!child) break;
|
||||
if ((child == -1) && (errno != EINTR)) break;
|
||||
|
||||
@@ -36,7 +36,7 @@ static void fatal2_cannot(char *m1, char *m2)
|
||||
static void warn3x(char *m1, char *m2, char *m3)
|
||||
{
|
||||
bb_error_msg("%s: warning: %s%s%s", svdir, m1, m2, m3);
|
||||
}
|
||||
}
|
||||
static void warn2_cannot(char *m1, char *m2)
|
||||
{
|
||||
warn3x("cannot ", m1, m2);
|
||||
@@ -44,7 +44,7 @@ static void warn2_cannot(char *m1, char *m2)
|
||||
static void warnx(char *m1)
|
||||
{
|
||||
warn3x(m1, "", "");
|
||||
}
|
||||
}
|
||||
|
||||
static void s_term(int sig_no)
|
||||
{
|
||||
@@ -208,7 +208,7 @@ int runsvdir_main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
curdir = open_read(".");
|
||||
if (curdir == -1)
|
||||
if (curdir == -1)
|
||||
fatal2_cannot("open current directory", "");
|
||||
coe(curdir);
|
||||
|
||||
@@ -241,7 +241,7 @@ int runsvdir_main(int argc, char **argv)
|
||||
/* wait at least a second */
|
||||
taia_uint(&deadline, 1);
|
||||
taia_add(&stampcheck, &now, &deadline);
|
||||
|
||||
|
||||
if (stat(svdir, &s) != -1) {
|
||||
if (check || s.st_mtime != mtime
|
||||
|| s.st_ino != ino || s.st_dev != dev
|
||||
|
||||
@@ -88,7 +88,7 @@ static unsigned svstatus_print(char *m)
|
||||
int pid;
|
||||
int normallyup = 0;
|
||||
struct stat s;
|
||||
|
||||
|
||||
if (stat("down", &s) == -1) {
|
||||
if (errno != ENOENT) {
|
||||
bb_perror_msg(WARN"cannot stat %s/down", *service);
|
||||
|
||||
@@ -141,7 +141,7 @@ static unsigned processorstart(struct logdir *ld)
|
||||
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);
|
||||
@@ -549,12 +549,12 @@ static unsigned logdir_open(struct logdir *ld, const char *fn)
|
||||
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;
|
||||
@@ -569,7 +569,7 @@ static void logdirs_reopen(void)
|
||||
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");
|
||||
|
||||
Reference in New Issue
Block a user