Ticket #8399: patch0.txt

File patch0.txt, 1.1 KB (added by judithc@…, 10 years ago)

patch for win32 compile

Line 
1*** original/main.cpp   Fri Apr 30 10:07:27 2010
2--- main.cpp    Thu Apr 29 17:21:50 2010
3***************
4*** 6,13 ****
5  #include <fcntl.h>
6  #include <libgen.h>
7  #include <signal.h>
8! #include <pwd.h>
9! #include <grp.h>
10 
11  #include "mythconfig.h"
12  #if CONFIG_DARWIN
13--- 6,15 ----
14  #include <fcntl.h>
15  #include <libgen.h>
16  #include <signal.h>
17! #ifndef _WIN32
18!   #include <pwd.h>
19!   #include <grp.h>
20! #endif
21 
22  #include "mythconfig.h"
23  #if CONFIG_DARWIN
24***************
25*** 870,875 ****
26--- 872,879 ----
27 
28      if (!username.isEmpty())
29      {
30+       
31+ #ifndef _WIN32
32          struct passwd *user_info = getpwnam(username.toLocal8Bit().constData());
33          const uid_t user_id = geteuid();
34 
35***************
36*** 914,919 ****
37--- 918,930 ----
38                      .arg(username));
39              return BACKEND_EXIT_PERMISSIONS_ERROR;
40          }
41+ #else
42+         {
43+             VERBOSE(VB_IMPORTANT,
44+                     "You cannot use -user switch in Windows.");
45+             return BACKEND_EXIT_PERMISSIONS_ERROR;
46+         }
47+ #endif
48      }
49 
50      if (pidfs)