recipes

packages recipes for the <noname> package manager
Log | Files | Refs

getprogname.diff (1221B)


      1 diff --git a/dfcompat.c b/dfcompat.c
      2 index 8df906e..6bea314 100644
      3 --- a/dfcompat.c
      4 +++ b/dfcompat.c
      5 @@ -116,7 +116,6 @@ getprogname(void)
      6  }
      7  
      8  #else /* __GLIBC__ */
      9 -#error "no getprogname implementation available"
     10  #endif
     11  
     12  #endif /* !HAVE_GETPROGNAME */
     13 diff --git a/dma.c b/dma.c
     14 index e643e0f..1c814b5 100644
     15 --- a/dma.c
     16 +++ b/dma.c
     17 @@ -70,6 +70,7 @@ char username[USERNAME_SIZE];
     18  uid_t useruid;
     19  const char *logident_base;
     20  char errmsg[ERRMSG_SIZE];
     21 +char *argv0;
     22  
     23  static int daemonize = 1;
     24  static int doqueue = 0;
     25 @@ -427,6 +428,7 @@ main(int argc, char **argv)
     26  	int nodot = 0, showq = 0, queue_only = 0;
     27  	int recp_from_header = 0;
     28  
     29 +	argv0 = argv[0];
     30  	set_username();
     31  
     32  	/*
     33 diff --git a/dma.h b/dma.h
     34 index ed0d0fc..5ef6176 100644
     35 --- a/dma.h
     36 +++ b/dma.h
     37 @@ -179,6 +179,7 @@ extern struct authusers authusers;
     38  extern char username[USERNAME_SIZE];
     39  extern uid_t useruid;
     40  extern const char *logident_base;
     41 +extern char *argv0;
     42  
     43  extern char neterr[ERRMSG_SIZE];
     44  extern char errmsg[ERRMSG_SIZE];
     45 diff --git a/util.c b/util.c
     46 index 5063a9d..e90a262 100644
     47 --- a/util.c
     48 +++ b/util.c
     49 @@ -50,6 +50,7 @@
     50  #include <unistd.h>
     51  
     52  #include "dma.h"
     53 +#define getprogname() argv0
     54  
     55  const char *
     56  hostname(void)