physical.c (165fbe26721123de50e5c2404bbf59b3057ebb6d) | physical.c (5284761414ce1ef5f00cb7e3f93076682b591a5e) |
---|---|
1/* 2 * Written by Eivind Eklund <eivind@yes.no> 3 * for Yes Interactive 4 * 5 * Copyright (C) 1998, Yes Interactive. All rights reserved. 6 * 7 * Redistribution and use in any form is permitted. Redistribution in 8 * source form should include the above copyright and this set of --- 307 unchanged lines hidden (view full) --- 316 } 317 318 return 1; 319} 320 321static void 322physical_Unlock(struct physical *p) 323{ | 1/* 2 * Written by Eivind Eklund <eivind@yes.no> 3 * for Yes Interactive 4 * 5 * Copyright (C) 1998, Yes Interactive. All rights reserved. 6 * 7 * Redistribution and use in any form is permitted. Redistribution in 8 * source form should include the above copyright and this set of --- 307 unchanged lines hidden (view full) --- 316 } 317 318 return 1; 319} 320 321static void 322physical_Unlock(struct physical *p) 323{ |
324 char fn[MAXPATHLEN]; | |
325 if (*p->name.full == '/' && p->type != PHYS_DIRECT && 326 ID0uu_unlock(p->name.base) == -1) | 324 if (*p->name.full == '/' && p->type != PHYS_DIRECT && 325 ID0uu_unlock(p->name.base) == -1) |
327 log_Printf(LogALERT, "%s: Can't uu_unlock %s\n", p->link.name, fn); | 326 log_Printf(LogALERT, "%s: Can't uu_unlock %s\n", p->link.name, 327 p->name.base); |
328} 329 330void 331physical_Close(struct physical *p) 332{ 333 int newsid; | 328} 329 330void 331physical_Close(struct physical *p) 332{ 333 int newsid; |
334 char fn[MAXPATHLEN]; | 334 char fn[PATH_MAX]; |
335 336 if (p->fd < 0) 337 return; 338 339 log_Printf(LogDEBUG, "%s: Close\n", p->link.name); 340 341 if (p->handler && p->handler->cooked) 342 (*p->handler->cooked)(p); --- 609 unchanged lines hidden (view full) --- 952 strncmp(p->name.full, _PATH_DEV, len) ? 953 p->name.full : p->name.full + len; 954} 955 956static void 957physical_Found(struct physical *p) 958{ 959 FILE *lockfile; | 335 336 if (p->fd < 0) 337 return; 338 339 log_Printf(LogDEBUG, "%s: Close\n", p->link.name); 340 341 if (p->handler && p->handler->cooked) 342 (*p->handler->cooked)(p); --- 609 unchanged lines hidden (view full) --- 952 strncmp(p->name.full, _PATH_DEV, len) ? 953 p->name.full : p->name.full + len; 954} 955 956static void 957physical_Found(struct physical *p) 958{ 959 FILE *lockfile; |
960 char fn[MAXPATHLEN]; | 960 char fn[PATH_MAX]; |
961 962 if (*p->name.full == '/') { 963 snprintf(fn, sizeof fn, "%s%s.if", _PATH_VARRUN, p->name.base); 964 lockfile = ID0fopen(fn, "w"); 965 if (lockfile != NULL) { 966 fprintf(lockfile, "%s%d\n", TUN_NAME, p->dl->bundle->unit); 967 fclose(lockfile); 968 } --- 123 unchanged lines hidden --- | 961 962 if (*p->name.full == '/') { 963 snprintf(fn, sizeof fn, "%s%s.if", _PATH_VARRUN, p->name.base); 964 lockfile = ID0fopen(fn, "w"); 965 if (lockfile != NULL) { 966 fprintf(lockfile, "%s%d\n", TUN_NAME, p->dl->bundle->unit); 967 fclose(lockfile); 968 } --- 123 unchanged lines hidden --- |