Merge branch 'storageareas' of github.com:ConnorTechnology/ZoneMinder into storageareas

This commit is contained in:
Isaac Connor 2017-01-15 14:07:55 -05:00
commit 6be61403f5
2 changed files with 16 additions and 1 deletions

View File

@ -6,7 +6,8 @@ Uploaders: Vagrant Cascadian <vagrant@debian.org>
Build-Depends: debhelper (>= 9), dh-systemd, python-sphinx | python3-sphinx, apache2-dev, dh-linktree
,cmake
,libx264-dev, libmp4v2-dev
,libavcodec-dev, libavformat-dev, libswscale-dev, libswresample-dev, libavutil-dev, libavdevice-dev
,libavcodec-dev, libavformat-dev, libswscale-dev
, libavutil-dev, libavdevice-dev
,libboost-dev
,libbz2-dev
,libgcrypt-dev

View File

@ -379,6 +379,20 @@ Monitor::Monitor(
Debug( 1, "mem.size=%d", mem_size );
mem_ptr = NULL;
char monitor_dir[PATH_MAX] = "";
snprintf( monitor_dir, sizeof(monitor_dir), "%s/%d", config.dir_events, id );
struct stat statbuf;
if ( stat( monitor_dir, &statbuf ) ) {
if ( errno == ENOENT || errno == ENOTDIR ) {
if ( mkdir( monitor_dir, 0755 ) ) {
Fatal( "Can't mkdir %s: %s", monitor_dir, strerror(errno));
}
} else {
Warning( "Error stat'ing %s, may be fatal. error is %s", monitor_dir, strerror(errno));
}
}
if ( purpose == CAPTURE ) {
this->connect();