nvi-03-db4.patch (788B)
1 #! /bin/sh /usr/share/dpatch/dpatch-run 2 ## 03db4.dpatch by <hesso@pool.math.tu-berlin.de> 3 ## 4 ## DP: libdb4 compatibility adjustments. 5 6 @DPATCH@ 7 --- nvi-1.81.6.orig/common/msg.c 2009-02-26 14:26:58.350336128 +0100 8 +++ nvi-1.81.6/common/msg.c 2009-02-26 14:29:05.235335829 +0100 9 @@ -724,9 +724,18 @@ 10 p = buf; 11 } else 12 p = file; 13 + if (access(p, F_OK) != 0) { 14 + if (first) { 15 + first = 0; 16 + return (1); 17 + } 18 + sp->db_error = ENOENT; 19 + msgq_str(sp, M_DBERR, p, "%s"); 20 + return (1); 21 + } 22 if ((sp->db_error = db_create(&db, 0, 0)) != 0 || 23 (sp->db_error = db->set_re_source(db, p)) != 0 || 24 - (sp->db_error = db_open(db, NULL, DB_RECNO, 0, 0)) != 0) { 25 + (sp->db_error = db_open(db, NULL, DB_RECNO, DB_CREATE, 0)) != 0) { 26 if (first) { 27 first = 0; 28 return (1);