[systemd-commits] src/sd-daemon.c

Lennart Poettering lennart at kemper.freedesktop.org
Tue Jul 6 16:42:24 PDT 2010


 src/sd-daemon.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fd8bccfbf9e50a7a0a209867130aac434e0754e7
Author: Martin Mikkelsen <mamikk at mamikk.no>
Date:   Tue Jul 6 23:27:56 2010 +0200

    sd-daemon: Fix path check in sd_is_fifo()
    
    sd_is_fifo() did fstat on the file descriptor twice instead of stating
    the supplied path.

diff --git a/src/sd-daemon.c b/src/sd-daemon.c
index cb568b5..5df70e3 100644
--- a/src/sd-daemon.c
+++ b/src/sd-daemon.c
@@ -141,7 +141,7 @@ int sd_is_fifo(int fd, const char *path) {
                 struct stat st_path;
 
                 memset(&st_path, 0, sizeof(st_path));
-                if (fstat(fd, &st_path) < 0) {
+                if (stat(path, &st_path) < 0) {
 
                         if (errno == ENOENT || errno == ENOTDIR)
                                 return 0;


More information about the systemd-commits mailing list