Added checks to return status of some functions.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2690 e3e1d417-86f3-4887-817a-d78f3d33393f
pull/27/merge
stan 2008-12-05 18:13:26 +00:00
parent 4489aeca09
commit 842398a32f
1 changed files with 4 additions and 2 deletions

View File

@ -486,8 +486,10 @@ Monitor::Monitor(
}
char temp_path[PATH_MAX];
snprintf( temp_path, sizeof(temp_path), "%d", id );
chdir( config.dir_events );
symlink( temp_path, name );
if ( chdir( config.dir_events ) < 0 )
Fatal( "Can't change directory to '%s': %s", config.dir_events, strerror(errno) );
if ( symlink( temp_path, name ) < 0 )
Fatal( "Can't symlink '%s' to '%s': %s", temp_path, name, strerror(errno) );
chdir( ".." );
}