diff options
author | james <> | 2008-02-28 01:51:43 +0000 |
---|---|---|
committer | james <> | 2008-02-28 01:51:43 +0000 |
commit | 6eb11161ee26aa9a67de6af702354c1d41831cf6 (patch) | |
tree | 44048682ce3d2bf8f1bbf65f0e14e73b06bc9140 /apps | |
parent | e2937a573de672f9cf6151478828adbe625b48aa (diff) | |
download | sympathy-6eb11161ee26aa9a67de6af702354c1d41831cf6.tar.gz sympathy-6eb11161ee26aa9a67de6af702354c1d41831cf6.tar.bz2 sympathy-6eb11161ee26aa9a67de6af702354c1d41831cf6.zip |
*** empty log message ***
Diffstat (limited to 'apps')
-rw-r--r-- | apps/sympathy.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/apps/sympathy.c b/apps/sympathy.c index 89cc552..91f6c0c 100644 --- a/apps/sympathy.c +++ b/apps/sympathy.c @@ -11,6 +11,9 @@ static char rcsid[] = /* * $Log$ + * Revision 1.22 2008/02/28 01:47:44 james + * *** empty log message *** + * * Revision 1.21 2008/02/27 16:01:24 james * *** empty log message *** * @@ -86,6 +89,7 @@ static char rcsid[] = #include <string.h> #include <strings.h> #include <malloc.h> +#include <fcntl.h> #include "mainloop.h" @@ -489,6 +493,31 @@ main (int argc, char *argv[]) } else { + /*HACK-- check that console=device does not occur in */ + /*/proc/cmdline*/ + if (!oargs['d']) + fatal_moan("no argument to -d"); + + { + char kernel_cmdline[4096]={0}; + char search_string[1024]="console="; + char *ptr=oargs['d']; + int fd; + + if (!strncmp("/dev/",ptr,5)) ptr+=5; + + strcat(search_string,ptr); + + fd=open("/proc/cmdline",O_RDONLY); + read(fd,kernel_cmdline,sizeof(kernel_cmdline)); + close(fd); + + kernel_cmdline[sizeof(kernel_cmdline)-1]=0; + + if (strstr(kernel_cmdline,search_string)) + fatal_moan("/proc/cmdline contains %s",search_string); + } + tty = serial_open (oargs['d'], oflags['K'] ? SERIAL_LOCK_ACTIVE : |