lc15: fsync requires fd instead of file stream

Change-Id: I7efb7280363b3a021b30c3b4eacb3aab70e9c8da
This commit is contained in:
Pau Espin 2018-06-11 12:49:00 +02:00 committed by Harald Welte
parent 5fceb9fc3a
commit a8041edb5b
1 changed files with 3 additions and 3 deletions

View File

@ -144,7 +144,7 @@ int lc15bts_par_set_int(void *ctx, enum lc15bts_par par, int val)
return -EIO;
}
fsync(fp);
fsync(fileno(fp));
fclose(fp);
return 0;
}
@ -176,7 +176,7 @@ int lc15bts_par_set_buf(void *ctx, enum lc15bts_par par, const uint8_t *buf, uns
rc = fwrite(buf, 1, size, fp);
fsync(fp);
fsync(fileno(fp));
fclose(fp);
return rc;
@ -225,7 +225,7 @@ int lc15bts_par_set_gps_fix(time_t val)
fclose(fp);
return -EIO;
}
fsync(fp);
fsync(fileno(fp));
fclose(fp);
return 0;