--- startsess.c 2002-08-05 01:38:06.000000000 -0400 +++ startsess.c 2004-07-08 01:27:13.000000000 -0400 @@ -1,10 +1,13 @@ /* * startsess * - * Copyright 2001 by James A. McQuillan + * Copyright (c) 2001,2002,2003 by James A. McQuillan + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. * - * This program is under the GNU General Public License (GPL) - * For the complete license, see the included 'COPYING' file. * * This program is written by James A. McQuillan, with help * from Ron Colcernian. @@ -18,6 +21,11 @@ * * usage: startsess tty prog [args] * + * Changes: + * + * 27/May/2003 Luiz Capitulino <lcapitulino@prefeitura.sp.gov.br> + * * Changed sys_errlist[] to strerror() + * * Added full GNU GPL text */ @@ -64,7 +72,7 @@ rs = stat( ttyname, &statbuf ); if( rs < 0 ){ printf("stat of %s failed: %s\n", - ttyname, sys_errlist[errno]); + ttyname, strerror(errno)); exit(1); } @@ -103,25 +111,25 @@ // if( rs1 < 0 ){ printf("setsid() failed, errno=%d %s\n", - errno, sys_errlist[errno]); + errno, strerror(errno)); } if( rs2 < 0 ){ printf("open() failed, errno=%d %s\n", - errno2, sys_errlist[errno]); + errno2, strerror(errno)); exit(1); } if( rs3 < 0 ){ printf("ioctl(tty,TIOCSCTTY,0) failed, errno=%d %s\n", - errno, sys_errlist[errno]); + errno, strerror(errno)); exit(1); } rs4 = execv(argv[2], argv+2 ); if( rs4 < 0 ){ printf("failed to exec %s: %s\n", - argv[2], sys_errlist[errno]); + argv[2], strerror(errno)); exit(1); } }