X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/blobdiff_plain/988b0fdbc6f7f0ba06673b500dbab365bdcc3c4c..bfab5602f254a61a5c7bf354ca184fa582b9e609:/lock.c diff --git a/lock.c b/lock.c index ad223ee..19392a8 100644 --- a/lock.c +++ b/lock.c @@ -1,13 +1,13 @@ /* -*-c-*- * - * $Id: lock.c,v 1.4 1999/06/19 20:33:16 mdw Exp $ + * $Id: lock.c,v 1.6 2004/04/08 01:36:13 mdw Exp $ * * Simplified POSIX locking interface * * (c) 1997 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of the mLib utilities library. * @@ -15,35 +15,18 @@ * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + * * mLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. - * + * * You should have received a copy of the GNU Library General Public * License along with mLib; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: lock.c,v $ - * Revision 1.4 1999/06/19 20:33:16 mdw - * More sophisticated and excessive signal and alarm handling. - * - * Revision 1.3 1999/06/06 01:23:00 mdw - * Fix signal handling. - * - * Revision 1.2 1999/05/26 20:53:40 mdw - * Fixes for stupid bugs. - * - * Revision 1.1 1999/05/15 10:33:53 mdw - * Add simplified locking code. - * - */ - /*----- Header files ------------------------------------------------------*/ #include @@ -66,7 +49,7 @@ /*----- Static variables --------------------------------------------------*/ -static sigjmp_buf jmp; /* Jump here to interrup @fcntl@ */ +static jmp_buf jmp; /* Jump here to interrup @fcntl@ */ /*----- Main code ---------------------------------------------------------*/ @@ -100,7 +83,7 @@ int lock_file(int fd, unsigned how) { struct flock fk; struct sigaction sa, osa; - sigset_t ss, oss; + sigset_t ss, oss; int e; int al, d, left;