diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-02-17 22:30:53 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-02-17 22:30:53 +0000 |
commit | fdffefb8032922ce7ffe4c00816072a8ff2148fc (patch) | |
tree | bc7313151a429c45d8bab8ad8b9dd32f4e51335f /src/libunixonacid/openwritenclose_devino_tmp.c | |
parent | a896ca2a8c617e5e00ffd5fc9e69331ad754e5b3 (diff) | |
download | skalibs-fdffefb8032922ce7ffe4c00816072a8ff2148fc.tar.xz |
More types changes
New disize
Add size_t to the autotypes list
Delete redundant and replace-libc files
dev_t/ino_t pass
Big size_t pass
More things missing, still not operational yet
Diffstat (limited to 'src/libunixonacid/openwritenclose_devino_tmp.c')
-rw-r--r-- | src/libunixonacid/openwritenclose_devino_tmp.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libunixonacid/openwritenclose_devino_tmp.c b/src/libunixonacid/openwritenclose_devino_tmp.c index 0fe032c..49eec93 100644 --- a/src/libunixonacid/openwritenclose_devino_tmp.c +++ b/src/libunixonacid/openwritenclose_devino_tmp.c @@ -1,25 +1,27 @@ /* ISC license. */ +#include <sys/types.h> #include <errno.h> #include <unistd.h> -#include <stdio.h> /* for rename() */ -#include <skalibs/uint64.h> +#include <stdio.h> +#include <skalibs/types.h> #include <skalibs/stralloc.h> #include <skalibs/djbunix.h> #include <skalibs/random.h> #include <skalibs/unix-transactional.h> -int openwritenclose_devino_tmp (char const *fn, char const *s, unsigned int len, uint64 *dev, uint64 *ino, stralloc *tmp) +int openwritenclose_devino_tmp (char const *fn, char const *s, size_t len, dev_t *dev, ino_t *ino, stralloc *tmp) { - uint64 tmpdev, tmpino ; - unsigned int base = tmp->len ; + dev_t tmpdev ; + ino_t tmpino ; + size_t base = tmp->len ; if (!stralloc_cats(tmp, fn)) return 0 ; if (!random_sauniquename(tmp, 8)) goto fail ; if (!stralloc_0(tmp)) goto fail ; if (!openwritenclose_unsafe_devino_sync(tmp->s + base, s, len, &tmpdev, &tmpino)) goto fail ; if (rename(tmp->s + base, fn) < 0) { - register int e = errno ; + int e = errno ; unlink(tmp->s + base) ; errno = e ; goto fail ; |