]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
asterisk.c: Don't log an error if .asterisk_history does not exist.
authorSean Bright <sean@seanbright.com>
Mon, 27 May 2024 13:43:12 +0000 (09:43 -0400)
committerSean Bright <sean@seanbright.com>
Wed, 5 Jun 2024 18:19:37 +0000 (18:19 +0000)
Fixes #751

main/asterisk.c

index e0a37ea6cfa969bd4a217c0383417cacb599ce2c..78fc4e33fdc017b1629f3bde8054532fde3d7da2 100644 (file)
@@ -3182,7 +3182,12 @@ static int ast_el_read_history(const char *filename)
                ast_el_initialize();
        }
 
-       return history(el_hist, &ev, H_LOAD, filename);
+       if (access(filename, F_OK) == 0) {
+               return history(el_hist, &ev, H_LOAD, filename);
+       }
+
+       /* If the history file doesn't exist, failing to read it is unremarkable. */
+       return 0;
 }
 
 static void process_histfile(int (*readwrite)(const char *filename))