X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fflock.c;h=f643f32d374345ec3c1219ad76aa6f1d8b958285;hb=a2ae92ef0232df237fef9af3e52b52b67d44cb93;hp=01bfd17aa6bd0375580da10c2be6e4d9f0226ef9;hpb=bdf01eb1c70d16bfaa72715b2c2a125be61eed85;p=gnulib.git diff --git a/lib/flock.c b/lib/flock.c index 01bfd17aa..f643f32d3 100644 --- a/lib/flock.c +++ b/lib/flock.c @@ -6,7 +6,7 @@ Written by Richard W.M. Jones - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008-2010 Free Software Foundation, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -130,27 +130,27 @@ flock (int fd, int operation) { DWORD err = GetLastError (); switch (err) - { - /* This means someone else is holding a lock. */ - case ERROR_LOCK_VIOLATION: - errno = EAGAIN; - break; - - /* Out of memory. */ - case ERROR_NOT_ENOUGH_MEMORY: - errno = ENOMEM; - break; - - case ERROR_BAD_COMMAND: - errno = EINVAL; - break; - - /* Unlikely to be other errors, but at least don't lose the - * error code. - */ - default: - errno = err; - } + { + /* This means someone else is holding a lock. */ + case ERROR_LOCK_VIOLATION: + errno = EAGAIN; + break; + + /* Out of memory. */ + case ERROR_NOT_ENOUGH_MEMORY: + errno = ENOMEM; + break; + + case ERROR_BAD_COMMAND: + errno = EINVAL; + break; + + /* Unlikely to be other errors, but at least don't lose the + * error code. + */ + default: + errno = err; + } return -1; }