init.c (47998) | init.c (49018) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Donn Seeley at Berkeley Software Design, Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 31 unchanged lines hidden (view full) --- 40 The Regents of the University of California. All rights reserved.\n"; 41#endif /* not lint */ 42 43#ifndef lint 44#if 0 45static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 7/15/93"; 46#endif 47static const char rcsid[] = | 1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Donn Seeley at Berkeley Software Design, Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 31 unchanged lines hidden (view full) --- 40 The Regents of the University of California. All rights reserved.\n"; 41#endif /* not lint */ 42 43#ifndef lint 44#if 0 45static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 7/15/93"; 46#endif 47static const char rcsid[] = |
48 "$Id: init.c,v 1.32 1999/06/16 20:01:19 ru Exp $"; | 48 "$Id: init.c,v 1.33 1999/06/18 09:08:09 ru Exp $"; |
49#endif /* not lint */ 50 51#include <sys/param.h> 52#include <sys/ioctl.h> 53#include <sys/mount.h> 54#include <sys/sysctl.h> 55#include <sys/wait.h> 56#include <sys/types.h> --- 873 unchanged lines hidden (view full) --- 930construct_argv(command) 931 char *command; 932{ 933 char *strk (char *); 934 register int argc = 0; 935 register char **argv = (char **) malloc(((strlen(command) + 1) / 2 + 1) 936 * sizeof (char *)); 937 | 49#endif /* not lint */ 50 51#include <sys/param.h> 52#include <sys/ioctl.h> 53#include <sys/mount.h> 54#include <sys/sysctl.h> 55#include <sys/wait.h> 56#include <sys/types.h> --- 873 unchanged lines hidden (view full) --- 930construct_argv(command) 931 char *command; 932{ 933 char *strk (char *); 934 register int argc = 0; 935 register char **argv = (char **) malloc(((strlen(command) + 1) / 2 + 1) 936 * sizeof (char *)); 937 |
938 if ((argv[argc++] = strk(command)) == 0) 939 return 0; | 938 if ((argv[argc++] = strk(command)) == 0) { 939 free(argv); 940 return (NULL); 941 } |
940 while ((argv[argc++] = strk((char *) 0)) != NULL) 941 continue; 942 return argv; 943} 944 945/* 946 * Deallocate a session descriptor. 947 */ --- 91 unchanged lines hidden (view full) --- 1039 if (sp->se_getty_argv == 0) { 1040 warning("can't parse getty for port %s", sp->se_device); 1041 free(sp->se_getty); 1042 free(sp->se_getty_argv_space); 1043 sp->se_getty = sp->se_getty_argv_space = 0; 1044 return (0); 1045 } 1046 if (sp->se_window) { | 942 while ((argv[argc++] = strk((char *) 0)) != NULL) 943 continue; 944 return argv; 945} 946 947/* 948 * Deallocate a session descriptor. 949 */ --- 91 unchanged lines hidden (view full) --- 1041 if (sp->se_getty_argv == 0) { 1042 warning("can't parse getty for port %s", sp->se_device); 1043 free(sp->se_getty); 1044 free(sp->se_getty_argv_space); 1045 sp->se_getty = sp->se_getty_argv_space = 0; 1046 return (0); 1047 } 1048 if (sp->se_window) { |
1047 free(sp->se_window); | 1049 free(sp->se_window); |
1048 free(sp->se_window_argv_space); 1049 free(sp->se_window_argv); 1050 } 1051 sp->se_window = sp->se_window_argv_space = 0; 1052 sp->se_window_argv = 0; 1053 if (typ->ty_window) { 1054 sp->se_window = strdup(typ->ty_window); 1055 sp->se_window_argv_space = strdup(sp->se_window); --- 614 unchanged lines hidden --- | 1050 free(sp->se_window_argv_space); 1051 free(sp->se_window_argv); 1052 } 1053 sp->se_window = sp->se_window_argv_space = 0; 1054 sp->se_window_argv = 0; 1055 if (typ->ty_window) { 1056 sp->se_window = strdup(typ->ty_window); 1057 sp->se_window_argv_space = strdup(sp->se_window); --- 614 unchanged lines hidden --- |