diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-27 05:08:53 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-27 05:08:53 +0000 |
commit | 253fd5fe6b485eef92e36b46bd17ccbc11f2c397 (patch) | |
tree | 21ada72472d498cc0b4a02febfb83b8fdc080969 /ext/sdbm | |
parent | 65d7479920d1bc94a25dbd759bb573c7b88c9fe1 (diff) |
ext: adjust indent [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/sdbm')
-rw-r--r-- | ext/sdbm/_sdbm.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c index 9ff0e7959a..3a42b0e569 100644 --- a/ext/sdbm/_sdbm.c +++ b/ext/sdbm/_sdbm.c @@ -176,24 +176,24 @@ sdbm_open(register char *file, register int flags, register int mode) static int fd_set_cloexec(int fd) { - /* MinGW don't have F_GETFD and FD_CLOEXEC. [ruby-core:40281] */ + /* MinGW don't have F_GETFD and FD_CLOEXEC. [ruby-core:40281] */ #ifdef F_GETFD - int flags, ret; - flags = fcntl(fd, F_GETFD); /* should not fail except EBADF. */ - if (flags == -1) { - return -1; - } - if (2 < fd) { - if (!(flags & FD_CLOEXEC)) { - flags |= FD_CLOEXEC; - ret = fcntl(fd, F_SETFD, flags); - if (ret == -1) { - return -1; - } - } - } + int flags, ret; + flags = fcntl(fd, F_GETFD); /* should not fail except EBADF. */ + if (flags == -1) { + return -1; + } + if (2 < fd) { + if (!(flags & FD_CLOEXEC)) { + flags |= FD_CLOEXEC; + ret = fcntl(fd, F_SETFD, flags); + if (ret == -1) { + return -1; + } + } + } #endif - return 0; + return 0; } DBM * @@ -400,20 +400,20 @@ makroom(register DBM *db, long int hash, int need) */ #if defined _WIN32 - /* - * Fill hole with 0 if made it. - * (hole is NOT read as 0) - */ - oldtail = lseek(db->pagf, 0L, SEEK_END); - memset(zer, 0, PBLKSIZ); - while (OFF_PAG(newp) > oldtail) { - if (lseek(db->pagf, 0L, SEEK_END) < 0 || - write(db->pagf, zer, PBLKSIZ) < 0) { + /* + * Fill hole with 0 if made it. + * (hole is NOT read as 0) + */ + oldtail = lseek(db->pagf, 0L, SEEK_END); + memset(zer, 0, PBLKSIZ); + while (OFF_PAG(newp) > oldtail) { + if (lseek(db->pagf, 0L, SEEK_END) < 0 || + write(db->pagf, zer, PBLKSIZ) < 0) { - return 0; + return 0; + } + oldtail += PBLKSIZ; } - oldtail += PBLKSIZ; - } #endif if (hash & (db->hmask + 1)) { |