physical.c (71006) | physical.c (74001) |
---|---|
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 9 * conditions, because large sections american law seems to have been 10 * created by a bunch of jerks on drugs that are now illegal, forcing 11 * me to include this copyright-stuff instead of placing this in the 12 * public domain. The name of of 'Yes Interactive' or 'Eivind Eklund' 13 * may not be used to endorse or promote products derived from this 14 * software without specific prior written permission. 15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 17 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18 * | 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 9 * conditions, because large sections american law seems to have been 10 * created by a bunch of jerks on drugs that are now illegal, forcing 11 * me to include this copyright-stuff instead of placing this in the 12 * public domain. The name of of 'Yes Interactive' or 'Eivind Eklund' 13 * may not be used to endorse or promote products derived from this 14 * software without specific prior written permission. 15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 17 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18 * |
19 * $FreeBSD: head/usr.sbin/ppp/physical.c 71006 2001-01-14 00:54:48Z brian $ | 19 * $FreeBSD: head/usr.sbin/ppp/physical.c 74001 2001-03-08 23:51:50Z brian $ |
20 * 21 */ 22 23#include <sys/param.h> 24#include <netinet/in.h> 25#include <netinet/in_systm.h> 26#include <netinet/ip.h> 27#include <sys/un.h> --- 288 unchanged lines hidden (view full) --- 316 } 317 318 return 1; 319} 320 321static void 322physical_Unlock(struct physical *p) 323{ | 20 * 21 */ 22 23#include <sys/param.h> 24#include <netinet/in.h> 25#include <netinet/in_systm.h> 26#include <netinet/ip.h> 27#include <sys/un.h> --- 288 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 --- |