Changeset 483
- Timestamp:
- Aug 16, 2010, 1:18:20 PM (15 years ago)
- Location:
- trunk/server/source3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/dynconfig.c
r481 r483 297 297 if (!*buffer) 298 298 { 299 snprintf(buffer, 260, "%s/samba/lock", getenv("ETC")); 299 if (os2_isClient()) 300 { 301 snprintf(buffer, 260, "%s/samba/lock/client", getenv("ETC")); 302 } else { 303 snprintf(buffer, 260, "%s/samba/lock", getenv("ETC")); 304 } 300 305 } 301 306 if (dyn_LOCKDIR == NULL) { -
trunk/server/source3/lib/os2helper.c
r463 r483 96 96 } 97 97 98 // we search the path of the .exe and return it99 int os2_GetExePath(char *buff)98 // get the exe name (including path) 99 bool os2_GetExeName(char *sExeName) 100 100 { 101 101 APIRET rc = NO_ERROR; 102 PPIB ppib = NULL; 103 char sExePath [_MAX_PATH]; 104 char sDrive [_MAX_PATH], sDir [_MAX_DIR]; 102 PPIB ppib = NULL; 105 103 106 104 // we search for the infoblock to get the module name … … 108 106 if (rc != NO_ERROR) 109 107 { 110 return -1;108 return false; 111 109 } 112 110 113 111 // with the module name we get the path (including the exe name) 114 rc = DosQueryModuleName(ppib->pib_hmte, sizeof(sExe Path), sExePath);112 rc = DosQueryModuleName(ppib->pib_hmte, sizeof(sExeName), sExeName); 115 113 if (rc != NO_ERROR) 116 114 { 117 return -1; 118 } 115 return false; 116 } 117 return true; 118 } 119 120 // we search the path of the .exe and return it 121 int os2_GetExePath(char *buff) 122 { 123 char sExeName [_MAX_PATH]; 124 char sDrive [_MAX_PATH], sDir [_MAX_DIR]; 125 126 if (!os2_GetExeName(sExeName)) 127 return false; 119 128 120 129 // we split to the different values 121 _splitpath(sExe Path, sDrive, sDir, NULL, NULL);130 _splitpath(sExeName, sDrive, sDir, NULL, NULL); 122 131 // strcat(sDrive, sDir); 123 132 strncat(sDrive, sDir, strlen(sDir) -1); … … 125 134 126 135 return 0; 136 } 137 138 // we search with the exe name if we are in client mode 139 bool os2_isClient() 140 { 141 char sExeName [_MAX_PATH]; 142 char sDrive [_MAX_PATH], sDir [_MAX_DIR], sName[_MAX_PATH]; 143 144 if (!os2_GetExeName(sExeName)) 145 return false; 146 147 // we split to the different values 148 _splitpath(sExeName, sDrive, sDir, sName, NULL); 149 if ( (stricmp(sName, "NDCTL") == 0) || (stricmp(sName, "EVFSCTL") == 0) ) 150 { 151 return true; 152 } else { 153 return false; 154 } 127 155 } 128 156
Note:
See TracChangeset
for help on using the changeset viewer.