Skip to content

Commit

Permalink
Fix compiler warning. Check return value of chdir.
Browse files Browse the repository at this point in the history
  • Loading branch information
kr committed May 15, 2009
1 parent e3bea22 commit 78e76c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion beanstalkd.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ dfork()
static void
daemonize()
{
chdir("/");
int r;

r = chdir("/");
if (r) return twarn("chdir");

nullfd(0, O_RDONLY);
nullfd(1, O_WRONLY);
nullfd(2, O_WRONLY);
Expand Down

0 comments on commit 78e76c3

Please sign in to comment.