3fcde4501d8fd546c8815471209341e334ec3928
[openwrt/svn-archive/archive.git] / net / djbdns / patches / 120-compiler-temporary-filename.patch
1 --- djbdns-1.05.original/pickdns-data.c 2001-02-11 21:11:45.000000000 +0000
2 +++ djbdns-1.05/pickdns-data.c 2003-10-19 10:47:17.000000000 +0100
3 @@ -123,7 +123,7 @@
4 }
5 void die_datatmp(void)
6 {
7 - strerr_die2sys(111,FATAL,"unable to create data.tmp: ");
8 + strerr_die2sys(111,FATAL,"unable to create data.cdb.tmp: ");
9 }
10
11 int main()
12 @@ -142,7 +142,7 @@
13 if (fd == -1) strerr_die2sys(111,FATAL,"unable to open data: ");
14 buffer_init(&b,buffer_unixread,fd,bspace,sizeof bspace);
15
16 - fdcdb = open_trunc("data.tmp");
17 + fdcdb = open_trunc("data.cdb.tmp");
18 if (fdcdb == -1) die_datatmp();
19 if (cdb_make_start(&cdb,fdcdb) == -1) die_datatmp();
20
21 @@ -223,8 +223,8 @@
22 if (cdb_make_finish(&cdb) == -1) die_datatmp();
23 if (fsync(fdcdb) == -1) die_datatmp();
24 if (close(fdcdb) == -1) die_datatmp(); /* NFS stupidity */
25 - if (rename("data.tmp","data.cdb") == -1)
26 - strerr_die2sys(111,FATAL,"unable to move data.tmp to data.cdb: ");
27 + if (rename("data.cdb.tmp","data.cdb") == -1)
28 + strerr_die2sys(111,FATAL,"unable to move data.cdb.tmp to data.cdb: ");
29
30 _exit(0);
31 }
32 --- djbdns-1.05.original/rbldns-data.c 2001-02-11 21:11:45.000000000 +0000
33 +++ djbdns-1.05/rbldns-data.c 2003-10-19 10:47:30.000000000 +0100
34 @@ -42,7 +42,7 @@
35 }
36 void die_datatmp(void)
37 {
38 - strerr_die2sys(111,FATAL,"unable to create data.tmp: ");
39 + strerr_die2sys(111,FATAL,"unable to create data.cdb.tmp: ");
40 }
41
42 int main()
43 @@ -59,7 +59,7 @@
44 if (fd == -1) strerr_die2sys(111,FATAL,"unable to open data: ");
45 buffer_init(&b,buffer_unixread,fd,bspace,sizeof bspace);
46
47 - fdcdb = open_trunc("data.tmp");
48 + fdcdb = open_trunc("data.cdb.tmp");
49 if (fdcdb == -1) die_datatmp();
50 if (cdb_make_start(&cdb,fdcdb) == -1) die_datatmp();
51
52 @@ -121,8 +121,8 @@
53 if (cdb_make_finish(&cdb) == -1) die_datatmp();
54 if (fsync(fdcdb) == -1) die_datatmp();
55 if (close(fdcdb) == -1) die_datatmp(); /* NFS stupidity */
56 - if (rename("data.tmp","data.cdb") == -1)
57 - strerr_die2sys(111,FATAL,"unable to move data.tmp to data.cdb: ");
58 + if (rename("data.cdb.tmp","data.cdb") == -1)
59 + strerr_die2sys(111,FATAL,"unable to move data.cdb.tmp to data.cdb: ");
60
61 _exit(0);
62 }
63 --- djbdns-1.05.original/tinydns-data.c 2001-02-11 21:11:45.000000000 +0000
64 +++ djbdns-1.05/tinydns-data.c 2003-10-19 11:59:16.000000000 +0100
65 @@ -27,7 +27,7 @@
66
67 void die_datatmp(void)
68 {
69 - strerr_die2sys(111,FATAL,"unable to create data.tmp: ");
70 + strerr_die2sys(111,FATAL,"unable to create data.cdb.tmp: ");
71 }
72 void nomem(void)
73 {
74 @@ -206,7 +206,7 @@
75
76 buffer_init(&b,buffer_unixread,fddata,bspace,sizeof bspace);
77
78 - fdcdb = open_trunc("data.tmp");
79 + fdcdb = open_trunc("data.cdb.tmp");
80 if (fdcdb == -1) die_datatmp();
81 if (cdb_make_start(&cdb,fdcdb) == -1) die_datatmp();
82
83 @@ -449,8 +449,8 @@
84 if (cdb_make_finish(&cdb) == -1) die_datatmp();
85 if (fsync(fdcdb) == -1) die_datatmp();
86 if (close(fdcdb) == -1) die_datatmp(); /* NFS stupidity */
87 - if (rename("data.tmp","data.cdb") == -1)
88 - strerr_die2sys(111,FATAL,"unable to move data.tmp to data.cdb: ");
89 + if (rename("data.cdb.tmp","data.cdb") == -1)
90 + strerr_die2sys(111,FATAL,"unable to move data.cdb.tmp to data.cdb: ");
91
92 _exit(0);
93 }