소스 검색

Exit on all utimes() errors -- maybe that will fix the multi-day issue

Zachary Kotlarek 13 년 전
부모
커밋
d2aaf60118
1개의 변경된 파일과 3개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 5
      motion/main.c

+ 3 - 5
motion/main.c

@@ -48,7 +48,7 @@ int main(int argc, const char * argv[])
 		for (i = 0; i < NUM_DEVICES; i++) {
 		for (i = 0; i < NUM_DEVICES; i++) {
 			if (readDev(device[i])) {
 			if (readDev(device[i])) {
 				motion = 1;
 				motion = 1;
-				i = NUM_DEVICES;
+				break;
 			}
 			}
 		}
 		}
 
 
@@ -58,10 +58,8 @@ int main(int argc, const char * argv[])
 			printf("Motion detected\n");
 			printf("Motion detected\n");
 			#endif
 			#endif
 			if (utimes(outfile, NULL) != 0) {
 			if (utimes(outfile, NULL) != 0) {
-				if (errno == ENOENT) {
-				} else {
-					fprintf(stderr, "Error touching output file (%s): %s\n", strerror(errno), outfile);
-				}
+				fprintf(stderr, "Error touching output file (%s): %s\n", strerror(errno), outfile);
+				exit(2);
 			}
 			}
 		} else {
 		} else {
 			#ifdef DEBUG
 			#ifdef DEBUG