mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-24 15:28:27 -04:00
use the return value of stat
This commit is contained in:
1 parent
007ebd3689
commit
2df96bf6ee
1 file changed
+1
-3
+1
-3
@@ -143,9 +143,7 @@ Event::Event( Monitor *p_monitor, struct timeval p_start_time, const std::string
|
||||
} else {
|
||||
snprintf( path, sizeof(path), "%s/%d/%d", storage->Path(), monitor->Id(), id );
|
||||
|
||||
errno = 0;
|
||||
stat( path, &statbuf );
|
||||
if ( errno == ENOENT || errno == ENOTDIR ) {
|
||||
if ( stat( path, &statbuf ) && ( errno == ENOENT || errno == ENOTDIR ) ) {
|
||||
if ( mkdir( path, 0755 ) ) {
|
||||
Error( "Can't mkdir %s: %s", path, strerror(errno));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user