summaryrefslogtreecommitdiff
path: root/community/udpxy/pidfile.patch
blob: 0adb249513009baa3fbdaf137d0c58c84cbc6d32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
diff --git a/udpxy.c b/udpxy.c
index 43f213a..8f0e30d 100644
--- a/udpxy.c
+++ b/udpxy.c
@@ -1423,7 +1423,7 @@ udpxy_main( int argc, char* const argv[] )
                 }
             }
 
-            rc = set_pidfile( g_udpxy_app, port, pidfile, sizeof(pidfile) );
+            rc = set_pidfile( g_udpxy_app, pidfile, sizeof(pidfile) );
             if( 0 != rc ) {
                 mperror( g_flog, errno, "set_pidfile" );
                 rc = ERR_INTERNAL; break;
diff --git a/util.c b/util.c
index 0ad34bb..6b7daf8 100644
--- a/util.c
+++ b/util.c
@@ -302,7 +302,7 @@ make_pidfile( const char* fpath, pid_t pid, FILE* log )
  * (fail if destination directory is not writable)
  */
 int
-set_pidfile( const char* appname, int port, char* buf, size_t len )
+set_pidfile( const char* appname, char* buf, size_t len )
 {
     int n = -1;
 
@@ -311,7 +311,7 @@ set_pidfile( const char* appname, int port, char* buf, size_t len )
     if( -1 == access(PIDFILE_DIR, W_OK ) )
         return -1;
 
-    n = snprintf( buf, len, "%s/%s%d.pid", PIDFILE_DIR, appname, port );
+    n = snprintf( buf, len, "%s/%s.pid", PIDFILE_DIR, appname );
     if( n < 0 ) return EXIT_FAILURE;
 
     buf[ len - 1 ] = '\0';
diff --git a/util.h b/util.h
index f274c7b..64a10d1 100644
--- a/util.h
+++ b/util.h
@@ -66,7 +66,7 @@ make_pidfile( const char* fpath, pid_t pid, FILE* log );
  * (fail of destination directory is not writable)
  */
 int
-set_pidfile( const char* appname, int port, char* buf, size_t len );
+set_pidfile( const char* appname, char* buf, size_t len );
 
 /* write buffer to designated socket/file
  * return number of bytes read/written or one of the error