Skip to content

Commit

Permalink
Silent some gcc warnings, also avoid common variable
Browse files Browse the repository at this point in the history
Signed-off-by: Werner Fink <[email protected]>
  • Loading branch information
bitstreamout committed Jan 9, 2020
1 parent 5f3daad commit ad2ea1d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions blogd.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,13 @@ int main(int argc, char *argv[])
{
const char *msg = "can not get terminal flags of stdin\n";
int flags;
int ret __attribute__ ((unused));

if ((flags = fcntl(0, F_GETFL)) < 0)
list_for_each_entry(c, &cons->node, node) {
if (c->fd < 0)
continue;
(void)write(c->fd, msg, strlen(msg));
ret = write(c->fd, msg, strlen(msg));
}
else {
flags &= ~(O_NONBLOCK);
Expand All @@ -448,7 +449,7 @@ int main(int argc, char *argv[])
list_for_each_entry(c, &cons->node, node) {
if (c->fd < 0)
continue;
(void)write(c->fd, msg, strlen(msg));
ret = write(c->fd, msg, strlen(msg));
}
}
}
Expand All @@ -467,11 +468,12 @@ int main(int argc, char *argv[])
list_for_each_entry(c, &cons->node, node) {
const char *msg = "blogd: can not fork to become daemon: ";
const char *err = strerror(errno);
int ret __attribute__ ((unused));
if (c->fd < 0)
continue;
(void)write(c->fd, msg, strlen(msg));
(void)write(c->fd, err, strlen(err));
(void)write(c->fd, "\n", 1);
ret = write(c->fd, msg, strlen(msg));
ret = write(c->fd, err, strlen(err));
ret = write(c->fd, "\n", 1);
}
exit(EXIT_FAILURE);
default:
Expand All @@ -491,8 +493,8 @@ int main(int argc, char *argv[])
fflush(stdout);

if (pipefd[0] > 0) {
int dummy;
read(pipefd[0], &dummy, 1);
int dummy, ret __attribute__ ((unused));
ret = read(pipefd[0], &dummy, 1);
close(pipefd[0]);
}

Expand Down
2 changes: 1 addition & 1 deletion libconsole/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static FILE *flog = NULL;
/*
* Signal control for writing on log file
*/
volatile sig_atomic_t nsigsys;
extern volatile sig_atomic_t nsigsys;

/*
* Our ring buffer
Expand Down

0 comments on commit ad2ea1d

Please sign in to comment.