From 842398a32f8c11a4f4bee39596c06a6f8f9112e1 Mon Sep 17 00:00:00 2001 From: stan Date: Fri, 5 Dec 2008 18:13:26 +0000 Subject: [PATCH] Added checks to return status of some functions. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2690 e3e1d417-86f3-4887-817a-d78f3d33393f --- src/zm_monitor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index d53c3658a..016e38b88 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -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( ".." ); }