diff options
author | Toomas Soome <tsoome@me.com> | 2017-02-15 22:19:17 +0200 |
---|---|---|
committer | Dan McDonald <danmcd@omniti.com> | 2017-03-21 14:54:17 -0400 |
commit | 2ed5314abaaa33c8ed0962cdac20e5a2b61de46b (patch) | |
tree | 8c4c21493ab04428cc3c48d167a3b1c05f5a76c0 /usr/src/lib/libadm/common | |
parent | 57a5ed5312451bb329b23563b4e85318e89308c7 (diff) | |
download | illumos-joyent-2ed5314abaaa33c8ed0962cdac20e5a2b61de46b.tar.gz |
7877 libadm: the if condition is wrong in devreserv.c
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src/lib/libadm/common')
-rw-r--r-- | usr/src/lib/libadm/common/devreserv.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/usr/src/lib/libadm/common/devreserv.c b/usr/src/lib/libadm/common/devreserv.c index ed9c5735d1..699fe94047 100644 --- a/usr/src/lib/libadm/common/devreserv.c +++ b/usr/src/lib/libadm/common/devreserv.c @@ -28,7 +28,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" /*LINTLIBRARY*/ /* @@ -464,20 +463,23 @@ writelks(int tblcnt) noerr = TRUE; /* Rewind the OA&M Device Lock File */ - if (lseek(lkfilefd, 0L, 0) >= 0L) + if (lseek(lkfilefd, 0L, 0) >= 0L) { /* Write the number of locks that will (eventually) exist */ if (write(lkfilefd, &lockcount, sizeof (int)) == sizeof (int)) { /* Write the table as we currently know it */ tblsz = tblcnt * sizeof (struct devlks); - if (tblsz) - if (!write(lkfilefd, locklist, tblsz) == (ssize_t)tblsz) + if (tblsz) { + if (write(lkfilefd, locklist, tblsz) != (ssize_t)tblsz) noerr = FALSE; /* Write of locks failed */ - - } else noerr = FALSE; /* write() of count failed */ - - else noerr = FALSE; /* Rewind failed */ + } + } else { + noerr = FALSE; /* write() of count failed */ + } + } else { + noerr = FALSE; /* Rewind failed */ + } /* Return an indicator of our success */ return (noerr); |