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.
This commit is contained in:
Martin Mikkelsen
2010-07-07 01:41:59 +02:00
committed by Lennart Poettering
parent f3e219a238
commit fd8bccfbf9
+1 -1
View File
@@ -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;