comparison src/c/mhash.c @ 1155:042f618f7c77

Call access() with F_OK
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Feb 2010 08:35:47 -0500
parents 6249df767d4c
children 236dc296c32d
comparison
equal deleted inserted replaced
1154:b0d632cc9edf 1155:042f618f7c77
28 assert(mhash_get_block_size(HASH_ALGORITHM) == HASH_BLOCKSIZE); 28 assert(mhash_get_block_size(HASH_ALGORITHM) == HASH_BLOCKSIZE);
29 29
30 if (uw_sig_file) { 30 if (uw_sig_file) {
31 int fd; 31 int fd;
32 32
33 if (access(uw_sig_file, 0)) { 33 if (access(uw_sig_file, F_OK)) {
34 random_password(); 34 random_password();
35 35
36 if ((fd = open(uw_sig_file, O_WRONLY | O_CREAT, 0700)) < 0) { 36 if ((fd = open(uw_sig_file, O_WRONLY | O_CREAT, 0700)) < 0) {
37 fprintf(stderr, "Can't open signature file %s\n", uw_sig_file); 37 fprintf(stderr, "Can't open signature file %s\n", uw_sig_file);
38 perror("open"); 38 perror("open");