diff options
author | Sergey Udaltsov <svu@gnome.org> | 2005-12-03 13:31:58 +0000 |
---|---|---|
committer | Sergey Udaltsov <svu@gnome.org> | 2005-12-03 13:31:58 +0000 |
commit | 4c6a68d404a397fae2fd600667072cae8ab71bbb (patch) | |
tree | 7f408ffed28f734b2c1abded72cd2e67273ddce0 /libxklavier/xklavier_config_xkb.c | |
parent | 9b35af3f4b38ad32016344d2a9815af6bf701b42 (diff) | |
download | libxklavier-4c6a68d404a397fae2fd600667072cae8ab71bbb.tar.gz |
wait -> waitpid, closed http://bugzilla.gnome.org/show_bug.cgi?id=322955
Diffstat (limited to 'libxklavier/xklavier_config_xkb.c')
-rw-r--r-- | libxklavier/xklavier_config_xkb.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/libxklavier/xklavier_config_xkb.c b/libxklavier/xklavier_config_xkb.c index e102137..d19106b 100644 --- a/libxklavier/xklavier_config_xkb.c +++ b/libxklavier/xklavier_config_xkb.c @@ -225,7 +225,7 @@ static XkbDescPtr _XklConfigGetKeyboard( XkbComponentNamesPtr componentNamesPtr, exit( 1 ); default: /* parent */ - pid = wait( &status ); + pid = waitpid( cpid, &status, 0 ); XklDebug( 150, "Return status of %d (well, started %d): %d\n", pid, cpid, status ); memset( (char *)&result, 0, sizeof(result) ); result.xkb = XkbAllocKeyboard(); @@ -261,9 +261,13 @@ static XkbDescPtr _XklConfigGetKeyboard( XkbComponentNamesPtr componentNamesPtr, } fclose( tmpxkm ); XklDebug( 160, "Unlinking the temporary xkm file %s\n", xkmFN ); - if ( remove( xkmFN ) == -1 ) - XklDebug( 0, "Could not unlink the temporary xkm file %s: %d\n", - xkmFN, errno ); + if ( _xklDebugLevel < 500 ) /* don't remove on high debug levels! */ + { + if ( remove( xkmFN ) == -1 ) + XklDebug( 0, "Could not unlink the temporary xkm file %s: %d\n", + xkmFN, errno ); + } else + XklDebug( 500, "Well, not really - the debug level is too high: %d\n", _xklDebugLevel ); } else /* could not open the file */ { XklDebug( 0, "Could not open the temporary xkm file %s\n", xkmFN ); @@ -277,9 +281,13 @@ static XkbDescPtr _XklConfigGetKeyboard( XkbComponentNamesPtr componentNamesPtr, break; } XklDebug( 160, "Unlinking the temporary xkb file %s\n", xkbFN ); - if ( remove( xkbFN ) == -1 ) - XklDebug( 0, "Could not unlink the temporary xkb file %s: %d\n", - xkbFN, errno ); + if ( _xklDebugLevel < 500 ) /* don't remove on high debug levels! */ + { + if ( remove( xkbFN ) == -1 ) + XklDebug( 0, "Could not unlink the temporary xkb file %s: %d\n", + xkbFN, errno ); + } else + XklDebug( 500, "Well, not really - the debug level is too high: %d\n", _xklDebugLevel ); } else /* could not open input tmp file */ { XklDebug( 0, "Could not open tmp XKB file [%s]: %d\n", xkbFN, errno ); |