Skip to content

Commit

Permalink
Revert "os-posix: report error message when lock file failed"
Browse files Browse the repository at this point in the history
This reverts commit e5048d1.

qemu_create_pidfile() is only created from main(), and there,
if that function returns failure, os_pidfile_error() function
is called, to, guess that, report error (which is done differently
whenever we're daemonizing or not).

qemu_create_pidfile() function has several error returns, this
lockf() failure is one of them, there are others (another shown
in the patch context too).

So this patch makes whole thing inconsistent at least.

If we need to show error message when we're daemonizing, it
looks like we should modify os_pidfile_error() routine to always
report error and only after that check for daemon mode.  This way
all errors will be reported the same way.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
Michael Tokarev committed Nov 2, 2014
1 parent 404ac83 commit 2fd7ae3
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions os-posix.c
Expand Up @@ -319,8 +319,6 @@ int qemu_create_pidfile(const char *filename)
return -1;
}
if (lockf(fd, F_TLOCK, 0) == -1) {
fprintf(stderr, "lock file '%s' failed: %s\n",
filename, strerror(errno));
close(fd);
return -1;
}
Expand Down

0 comments on commit 2fd7ae3

Please sign in to comment.