summaryrefslogtreecommitdiff
path: root/trans
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2006-03-25 22:20:20 +0000
committerThomas Schwinge <tschwinge@gnu.org>2006-03-25 22:20:20 +0000
commitaadfc1c4499b7952b37290867e079ef4a47207e6 (patch)
tree840fb710be6b5b0298ec80ba902bf0d16d56ba0e /trans
parent2b8c82540a96f17c3eebb272190046253efcc354 (diff)
2006-03-25 Thomas Schwinge <tschwinge@gnu.org>
[bug #15808] * ifsock.c: Include <argp.h>, <sys/cdefs.h> and <version.h>. (__XSTRING): New macro. (argp_program_version, doc, argp): New variables. (main): Call argp_parse(). Based on a patch by Ben Asselstine <benasselstine@gmail.com>.
Diffstat (limited to 'trans')
-rw-r--r--trans/ChangeLog9
-rw-r--r--trans/ifsock.c22
2 files changed, 29 insertions, 2 deletions
diff --git a/trans/ChangeLog b/trans/ChangeLog
index 94364812..47de6762 100644
--- a/trans/ChangeLog
+++ b/trans/ChangeLog
@@ -1,3 +1,12 @@
+2006-03-25 Thomas Schwinge <tschwinge@gnu.org>
+
+ [bug #15808]
+ * ifsock.c: Include <argp.h>, <sys/cdefs.h> and <version.h>.
+ (__XSTRING): New macro.
+ (argp_program_version, doc, argp): New variables.
+ (main): Call argp_parse().
+ Based on a patch by Ben Asselstine <benasselstine@gmail.com>.
+
2005-07-12 Marcus Brinkmann <marcus@gnu.org>
* magic.c (magic_getroot): Deallocate DOTDOT if processing here.
diff --git a/trans/ifsock.c b/trans/ifsock.c
index 4d7c4301..092bb40d 100644
--- a/trans/ifsock.c
+++ b/trans/ifsock.c
@@ -1,5 +1,5 @@
/* Server for S_IFSOCK nodes
- Copyright (C) 1994, 1995, 2001, 02 Free Software Foundation
+ Copyright (C) 1994, 1995, 2001, 02, 2006 Free Software Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -26,9 +26,24 @@
#include <stdlib.h>
#include <error.h>
#include <fcntl.h>
+#include <argp.h>
+
+#include <sys/cdefs.h>
+#ifndef __XSTRING /* Could / should (?) be provided by glibc. */
+#define __XSTRING(x) __STRING(x) /* Expand x, then stringify. */
+#endif
+
+#include <version.h>
#include "ifsock_S.h"
+const char *argp_program_version = STANDARD_HURD_VERSION (ifsock);
+
+static const char doc[] = "A translator to provide Unix domain sockets."
+"\vThis translator acts as a hook for Unix domain sockets."
+" The pflocal translator on " _SERVERS_SOCKET "/" __XSTRING(PF_LOCAL)
+" implements the sockets.";
+
mach_port_t address_port;
struct port_class *control_class;
@@ -63,6 +78,9 @@ main (int argc, char **argv)
mach_port_t pflocal;
mach_port_t bootstrap;
char buf[512];
+ const struct argp argp = { 0, 0, 0, doc };
+
+ argp_parse (&argp, argc, argv, 0, 0, 0);
control_class = ports_create_class (trivfs_clean_cntl, 0);
node_class = ports_create_class (trivfs_clean_protid, 0);
@@ -99,7 +117,7 @@ main (int argc, char **argv)
ports_manage_port_operations_one_thread (port_bucket, demuxer, 0);
return 0;
}
-
+
void
trivfs_modify_stat (struct trivfs_protid *cred, struct stat *st)
{