summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 06a4718)
raw | patch | inline | side by side (parent: 06a4718)
author | Florian Forster <octo@crystal.wlan.home.verplant.org> | |
Mon, 22 Jan 2007 21:52:14 +0000 (22:52 +0100) | ||
committer | Florian Forster <octo@crystal.wlan.home.verplant.org> | |
Mon, 22 Jan 2007 21:52:14 +0000 (22:52 +0100) |
It didn't work on Mac OS X for example.
src/csv.c | patch | blob | history |
diff --git a/src/csv.c b/src/csv.c
index b22f176ff2bddcf2d003d6e28db33bc62b38e24d..dd33ca5e4876ea42d33f1db618a72c4d1d70b58f 100644 (file)
--- a/src/csv.c
+++ b/src/csv.c
char values[512];
FILE *csv;
int csv_fd;
- struct flock fl = { F_WRLCK, SEEK_SET, 0, 0, getpid () };
+ struct flock fl;
int status;
if (value_list_to_filename (filename, sizeof (filename), ds, vl) != 0)
}
csv_fd = fileno (csv);
+ memset (&fl, '\0', sizeof (fl));
+ fl.l_start = 0;
+ fl.l_len = 0; /* till end of file */
+ fl.l_pid = getpid ();
+ fl.l_type = F_WRLCK;
+ fl.l_whence = SEEK_SET;
+
status = fcntl (csv_fd, F_SETLK, &fl);
if (status != 0)
{