net-dialup/dwun: Fix building with CFLAGS=-fno-common
[gentoo.git] / net-dialup / dwun / files / dwun-0.96e-fno-common.patch
1 --- a/src/main.c
2 +++ b/src/main.c
3 @@ -37,11 +37,11 @@
4  /* extern'ed in main.h */
5  struct settings set;
6  char *error_messages;
7 +enum MYLOG_OPTIONS MYLOG_OPTIONS = MYLOG_STDERR;
8  
9  int main(int argc, char *argv[]) 
10  {
11         char orig_work_dir[MAXPATHLEN];
12 -       MYLOG_OPTIONS = MYLOG_STDERR;
13         umask(022); /* -rw-r--r- */
14  
15         if (!(error_messages = xmalloc(MAX_LOG_LENGTH)))
16 --- a/src/shared.h
17 +++ b/src/shared.h
18 @@ -56,10 +56,11 @@
19         char *external;                 /* named pipe (optional) */
20  };
21  
22 -enum {
23 +enum MYLOG_OPTIONS {
24         MYLOG_STDERR,
25         MYLOG_STDERR_DATEPID,
26         MYLOG_SYSLOG
27 -} MYLOG_OPTIONS;
28 +};
29 +extern enum MYLOG_OPTIONS MYLOG_OPTIONS;
30  
31  #endif
32 --- a/src/util.c
33 +++ b/src/util.c
34 @@ -26,6 +26,7 @@
35  #include "util.h"
36  #include "child.h"
37  #include "main.h"
38 +#include "shared.h"
39  
40  static bool create_file(char *file, int options);
41  static void print_date_pid(void);