aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-08-22 01:27:27 +0200
committerMattias Andrée <maandree@operamail.com>2015-08-22 01:27:27 +0200
commite5db9ec4d879b6463bafa19a492c710b9113dc86 (patch)
tree507df4d57f48e78f55953e58cca5acf189a5fe36
parentensure that all PF_ and AF_ aliases exists if any exist (diff)
downloadmds-e5db9ec4d879b6463bafa19a492c710b9113dc86.tar.gz
mds-e5db9ec4d879b6463bafa19a492c710b9113dc86.tar.bz2
mds-e5db9ec4d879b6463bafa19a492c710b9113dc86.tar.xz
the first argument on socket() should be PF_, not AF_ as often documented, although it does not really matter because PF_ to AF_ is a bijective identity mapping (PF_UNSPEC was even added to make this true.)
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--src/mds.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mds.c b/src/mds.c
index 05a0758..f184b07 100644
--- a/src/mds.c
+++ b/src/mds.c
@@ -186,7 +186,7 @@ int main(int argc_, char** argv_)
address.sun_family = AF_UNIX;
strcpy(address.sun_path, pathname);
unlink(pathname);
- fail_if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0);
+ fail_if ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0);
fail_if (fchmod(fd, S_IRWXU) < 0);
fail_if (bind(fd, (struct sockaddr*)(&address), sizeof(address)) < 0);
fail_if (chown(pathname, getuid(), NOBODY_GROUP_GID) < 0);