+ if (hdat->value == NULL) {
+ hdat->file = open(file, O_WRONLY|O_TRUNC|O_CREAT, 0600);
+ if (hdat->file == 0) {
+ hdat->file = dup(0);
+ close(0);
+ }
+ if (hdat->file <= 0) {
+ hdat->file = 0;
+ return 0;
+ }
+ hdat->value = strdup(file);
+ if (hdat->value == NULL) {
+ close(hdat->file);
+ hdat->file = 0;
+ return 0;
+ }
+ } else {
+ if (strcmp(hdat->value, file))
+ return 0;
+ }