diff options
author | Darrell Anderson <[email protected]> | 2012-03-07 17:48:37 -0600 |
---|---|---|
committer | Darrell Anderson <[email protected]> | 2012-03-07 17:48:37 -0600 |
commit | 73026fb639b1ab6c0e66fea935f0f8f2224189a3 (patch) | |
tree | 4b8a1b80056ca629c1e912989ad0aeb075069657 /tdm | |
parent | 769054446b8e43589e94869240e8642e5b93e9df (diff) | |
download | tdebase-73026fb639b1ab6c0e66fea935f0f8f2224189a3.tar.gz tdebase-73026fb639b1ab6c0e66fea935f0f8f2224189a3.zip |
Add source code module name to stdout/stderr messages to improve readability.
Diffstat (limited to 'tdm')
-rw-r--r-- | tdm/kfrontend/tdmctl.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/tdm/kfrontend/tdmctl.c b/tdm/kfrontend/tdmctl.c index d6abe959a..a0d9a41f8 100644 --- a/tdm/kfrontend/tdmctl.c +++ b/tdm/kfrontend/tdmctl.c @@ -45,7 +45,7 @@ openctl( int fd, int err, const char *ctl, const char *dpy ) if (!connect( fd, (struct sockaddr *)&sa, sizeof(sa) )) return 1; if (err) - fprintf( stderr, "Cannot connect socket '%s'.\n", sa.sun_path ); + fprintf( stderr, "[tdmctl] Cannot connect socket '%s'.\n", sa.sun_path ); return 0; } @@ -58,9 +58,7 @@ readcfg( const char *cfg ) char buf[1024]; if (!(fp = fopen( cfg, "r" ))) { - fprintf( stderr, - "Cannot open tdm config file '%s'.\n", - cfg ); + fprintf( stderr, "[tdmctl] Cannot open tdm config file '%s'.\n", cfg ); return 0; } ctl = "/var/run/xdmctl"; @@ -90,7 +88,7 @@ exe( int fd, const char *in, int len ) char buf[4096]; if (write( fd, in, len ) != len) { - fprintf( stderr, "Cannot send command\n" ); + fprintf( stderr, "[tdmctl] Cannot send command\n" ); return 1; } do { @@ -138,7 +136,7 @@ run( int fd, char **argv ) buf[len++] = '\n'; return exe( fd, buf, len ); bad: - fprintf( stderr, "Command too long\n" ); + fprintf( stderr, "[tdmctl] Command too long\n" ); return 1; } } @@ -201,20 +199,20 @@ main( int argc, char **argv ) } else if (!strcmp( ptr, "c" ) || !strcmp( ptr, "config" )) { if (!argv[1]) { needarg: - fprintf( stderr, "Option '%s' needs argument.\n", + fprintf( stderr, "[tdmctl] Option '%s' needs argument.\n", ptr ); return 1; } cfg = *++argv; } else { - fprintf( stderr, "Unknown option '%s'.\n", ptr ); + fprintf( stderr, "[tdmctl] Unknown option '%s'.\n", ptr ); return 1; } } if ((!ctl || !*ctl) && *cfg) ctl = readcfg( cfg ); if ((fd = socket( PF_UNIX, SOCK_STREAM, 0 )) < 0) { - fprintf( stderr, "Cannot create UNIX socket\n" ); + fprintf( stderr, "[tdmctl] Cannot create UNIX socket\n" ); return 1; } if (dpy && (ptr = strchr( dpy, ':' )) && (ptr = strchr( ptr, '.' ))) @@ -226,7 +224,7 @@ main( int argc, char **argv ) if (!openctl( fd, 0, "/var/run/xdmctl", dpy ) && !openctl( fd, 0, "/var/run", dpy )) { - fprintf( stderr, "No command socket found.\n" ); + fprintf( stderr, "[tdmctl] No command socket found.\n" ); return 1; } } |