return r == -EINVAL ? -EUCLEAN : r;
}
-int id128_read(const char *p, Id128FormatFlag f, sd_id128_t *ret) {
+int id128_read(const char *path, Id128FormatFlag f, sd_id128_t *ret) {
_cleanup_close_ int fd = -EBADF;
- fd = open(p, O_RDONLY|O_CLOEXEC|O_NOCTTY);
+ assert(path);
+
+ fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY);
if (fd < 0)
return -errno;
return 0;
}
-int id128_write(const char *p, Id128FormatFlag f, sd_id128_t id) {
+int id128_write(const char *path, Id128FormatFlag f, sd_id128_t id) {
_cleanup_close_ int fd = -EBADF;
- fd = open(p, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY|O_TRUNC, 0444);
+ assert(path);
+
+ fd = open(path, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY|O_TRUNC, 0444);
if (fd < 0)
return -errno;
} Id128FormatFlag;
int id128_read_fd(int fd, Id128FormatFlag f, sd_id128_t *ret);
-int id128_read(const char *p, Id128FormatFlag f, sd_id128_t *ret);
+int id128_read(const char *path, Id128FormatFlag f, sd_id128_t *ret);
int id128_write_fd(int fd, Id128FormatFlag f, sd_id128_t id);
-int id128_write(const char *p, Id128FormatFlag f, sd_id128_t id);
+int id128_write(const char *path, Id128FormatFlag f, sd_id128_t id);
void id128_hash_func(const sd_id128_t *p, struct siphash *state);
int id128_compare_func(const sd_id128_t *a, const sd_id128_t *b) _pure_;