bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] libdiskfs/ifsock.c


From: Neal H Walfield
Subject: [PATCH] libdiskfs/ifsock.c
Date: Wed, 20 Jun 2001 23:45:04 -0500
User-agent: Mutt/1.3.18i

Two small clean ups:

libdiskfs/ChangeLog:

2001-06-20  Neal H Walfield  <neal@cs.uml.edu>

        * ifsock.c (pflocalserver): Elide superfluous initialization to
        zero.
        (diskfs_S_ifsock_getsockaddr): Don't use sprint when we can just
        use the preprocessor.


Index: ifsock.c
===================================================================
RCS file: /home/neal/cvs/hurd/libdiskfs/ifsock.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ifsock.c
--- ifsock.c    2001/06/03 20:53:19     1.1.1.1
+++ ifsock.c    2001/06/21 04:42:11
@@ -1,5 +1,5 @@
 /* Implement ifsock inteface
-   Copyright (C) 1994, 1996 Free Software Foundation
+   Copyright (C) 1994, 1996, 2001 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
@@ -23,7 +23,7 @@
 #include <hurd/socket.h>
 
 static spin_lock_t pflocalserverlock = SPIN_LOCK_INITIALIZER;
-static mach_port_t pflocalserver = MACH_PORT_NULL;
+static mach_port_t pflocalserver;
 
 kern_return_t
 diskfs_S_ifsock_getsockaddr (struct protid *cred,
@@ -66,13 +66,11 @@
       if (pflocalserver == MACH_PORT_NULL)
        {
          /* Find out who the PF_LOCAL server is. */
-         char buf[100];
-
          spin_unlock (&pflocalserverlock);
 
          /* Look it up */
-         sprintf (buf, "%s/%d", _SERVERS_SOCKET, PF_LOCAL);
-         server = file_name_lookup (buf, 0, 0);
+         server = file_name_lookup (_SERVERS_SOCKET "/" STRINGIFY (PF_LOCAL),
+                                    0, 0);
          if (server == MACH_PORT_NULL)
            return EIEIO;
 

Attachment: pgpFSki8A9vgd.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]