X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ovsdb%2Flog.c;h=48fa847912cb5a9330c9fac72c3783483a5e10fa;hb=1f14e0558dc6e77f9fab836ccfad00341535057d;hp=13160257612dc704a3026a2548dc0a12042bf77d;hpb=6e274d49c4ebae2e79bcaca89a64e42e67596d2d;p=sliver-openvswitch.git diff --git a/ovsdb/log.c b/ovsdb/log.c index 131602576..48fa84791 100644 --- a/ovsdb/log.c +++ b/ovsdb/log.c @@ -91,6 +91,7 @@ ovsdb_log_open(const char *name, enum ovsdb_log_open_mode open_mode, } else if (open_mode == OVSDB_LOG_READ_WRITE) { flags = O_RDWR; } else if (open_mode == OVSDB_LOG_CREATE) { +#ifndef _WIN32 if (stat(name, &s) == -1 && errno == ENOENT && lstat(name, &s) == 0 && S_ISLNK(s.st_mode)) { /* 'name' is a dangling symlink. We want to create the file that @@ -101,8 +102,11 @@ ovsdb_log_open(const char *name, enum ovsdb_log_open_mode open_mode, } else { flags = O_RDWR | O_CREAT | O_EXCL; } +#else + flags = O_RDWR | O_CREAT | O_EXCL; +#endif } else { - NOT_REACHED(); + OVS_NOT_REACHED(); } fd = open(name, flags, 0666); if (fd < 0) { @@ -356,7 +360,7 @@ ovsdb_log_write(struct ovsdb_log *file, struct json *json) /* Compose header. */ sha1_bytes(json_string, length, sha1); - snprintf(header, sizeof header, "%s%zu "SHA1_FMT"\n", + snprintf(header, sizeof header, "%s%"PRIuSIZE" "SHA1_FMT"\n", magic, length, SHA1_ARGS(sha1)); /* Write. */