Changeset 850 for branches/samba-3.5.x
- Timestamp:
- Feb 17, 2014, 3:26:37 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.5.x/source3/lib/os2helper.c
r773 r850 41 41 #include <string.h> 42 42 #include <sys/socket.h> 43 //YD for tmalloc44 43 #include <malloc.h> 45 44 … … 52 51 #define aARCH (1L<<5) /* 0x20 */ 53 52 54 #ifndef TESTING55 56 53 // Samba DEBUG() needs the following includes and defines 57 54 #include <stdbool.h> … … 61 58 #include "../lib/util/xfile.h" 62 59 #include "debug.h" 63 #else64 65 #define DEBUG(a,b) (0)66 #endif67 60 68 61 #ifndef ENOATTR … … 159 152 } 160 153 161 // we search with the exe name if we are in client mode162 /* not needed atm, as done with lp_is_in_client()163 bool os2_isClient()164 {165 char sExeName [_MAX_PATH];166 char sDrive [_MAX_PATH], sDir [_MAX_DIR], sName[_MAX_PATH];167 168 if (!os2_GetExeName(sExeName, sizeof(sExeName)))169 return false;170 171 // we split to the different values172 _splitpath(sExeName, sDrive, sDir, sName, NULL);173 if ( (stricmp(sName, "NDCTL") == 0) || (stricmp(sName, "EVFSCTL") == 0) )174 {175 return true;176 } else {177 return false;178 }179 }180 */181 182 154 /* OS/2 specific pipe implementation, we have to use socketpair as select on 183 filehandle is not working. */155 filehandle is not working. */ 184 156 int os2_pipe(int fds[2]) 185 157 { … … 190 162 } 191 163 192 #if 0193 // OS/2 specific connect() implementation, as it only works in low mem194 int os2_connect(int fd, const struct sockaddr *address, int address_len)195 {196 struct sockaddr *addresslow;197 int rc;198 addresslow = (struct sockaddr*) _lmalloc(address_len);199 if (!addresslow)200 return -1;201 202 memcpy(addresslow, address, address_len);203 rc = connect(fd, addresslow, address_len);204 205 free(addresslow);206 207 return rc;208 }209 #endif210 211 164 /* OS/2-specific random functions. these functions used to be based on APR 212 165 random code, but we discovered some nasty problems with it on fast hardware 213 (especially on quadcore) and decided to rewrite it with libc random() */ 214 166 (especially on quadcore) and decided to rewrite it with libc random() */ 215 167 void os2_randget(char * buffer, int length) 216 168 { … … 339 291 free(pfea2list); 340 292 } 341 DEBUG(4,("unigetxattr : (%s:%d) %s %d\n", path ? path : "null", file, name, rc)); 293 294 DEBUG(5,("unigetxattr : (%s:%d) %s %d\n", path ? path : "null", file, name, rc)); 295 342 296 return rc; 343 297 } … … 373 327 if (rc) 374 328 { 375 DEBUG(4,("unilistxattr1 : (%s:%d) %d\n", path ? path : "null", file, rc));329 DEBUG(4,("unilistxattr1 : (%s:%d) %d\n", path ? npath : "null", file, rc)); 376 330 maperrno(rc); 377 331 return -1; … … 384 338 //YD DosEnumAttribute doesn't like high-mem buffers, get a low one. 385 339 buf = (char *)_tmalloc(stat.cbList * 2); 386 rc = DosEnumAttribute(path ? 1 : 0, path ? (PVOID) path : (PVOID)&file, 1, (PVOID)buf, stat.cbList * 2, &ulCount, 1);340 rc = DosEnumAttribute(path ? 1 : 0, path ? (PVOID)npath : (PVOID)&file, 1, (PVOID)buf, stat.cbList * 2, &ulCount, 1); 387 341 if (rc) 388 342 { 389 DEBUG(4,("unilistxattr2 : (%s:%d) %d\n", path ? path : "null", file, rc));343 DEBUG(4,("unilistxattr2 : (%s:%d) %d\n", path ? npath : "null", file, rc)); 390 344 maperrno(rc); 391 345 _tfree(buf); … … 408 362 if (pfea->oNextEntryOffset > 0x10000) 409 363 { 410 // DEBUG(0, ("Broken Extended Attributes detected for: %s:%d\n", path ? path : "null", file)); 411 DEBUG(0, ("Broken Extended Attributes detected for: %s:%d, Last EA:%s\n", path ? path : "null", file, pfea->szName)); 364 DEBUG(4, ("Broken Extended Attributes detected for: %s:%d, Last EA:%s\n", path ? path : "null", file, pfea->szName)); 412 365 break; 413 366 } … … 418 371 } 419 372 _tfree(buf); 420 DEBUG(4,("unilistxattr : (%s:%d) %d\n", path ? path : "null", file, gotsize)); 373 374 DEBUG(5,("unilistxattr : (%s:%d) %d\n", path ? path : "null", file, gotsize)); 375 421 376 if (gotsize > size) 422 377 { … … 491 446 PFEA2LIST pfea2list = NULL; 492 447 char * p; 493 DEBUG(4,("unisetxattr : (%s:%d) %s %d\n", path ? path : "null", file, name, size)); 448 449 DEBUG(5,("unisetxattr : (%s:%d) %s %d\n", path ? path : "null", file, name, size)); 450 494 451 if ((!path && !file) || !name || (!value && size)) 495 452 {
Note:
See TracChangeset
for help on using the changeset viewer.