Changeset 144 for trunk/src/slib.c


Ignore:
Timestamp:
Oct 31, 2007, 11:33:13 PM (17 years ago)
Author:
rainer
Message:

Fix some more queer compile problems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/slib.c

    r137 r144  
    5555#define SH_NEED_PWD_GRP 1
    5656#include "sh_static.h"
     57#include "sh_pthread.h"
    5758
    5859#undef  FIL__
     
    15141515static SL_OFILE * ofiles[MAXFD];
    15151516
     1517SH_MUTEX_STATIC(mutex_ticket, PTHREAD_MUTEX_INITIALIZER);
    15161518
    15171519static unsigned int nonce_counter = TOFFSET;
     
    15221524  unsigned int high; /* index */
    15231525  unsigned int low;  /* nonce */
     1526  SL_TICKET    retval = SL_EINTERNAL;
    15241527
    15251528  SL_ENTER(_("sl_create_ticket"));
    15261529
    1527   if (myindex >= MAXFD) 
    1528     SL_IRETURN (SL_EINTERNAL, _("sl_create_ticket"));
     1530  if (myindex >= MAXFD)
     1531    goto out_ticket;
    15291532
    15301533  /* mask out the high bit and check that it is not used
     
    15341537
    15351538  if (high != myindex + TOFFSET)
    1536     SL_IRETURN (SL_EINTERNAL, _("sl_create_ticket"));
     1539    goto out_ticket;
     1540
     1541  SH_MUTEX_LOCK_UNSAFE(mutex_ticket);
    15371542
    15381543  low = nonce_counter & 0xffff;
     
    15411546   */
    15421547  if ((low != nonce_counter++) || low == 0)
    1543     SL_IRETURN (SL_EINTERNAL, _("sl_create_ticket"));
     1548    goto out_ticket;
    15441549 
    15451550  /* Wrap around the nonce counter.
     
    15491554    nonce_counter = TOFFSET;
    15501555
    1551   SL_RETURN ((SL_TICKET) ((high << 16) | low), _("sl_create_ticket"));
     1556  retval = (SL_TICKET) ((high << 16) | low);
     1557
     1558 out_ticket:
     1559  ;
     1560
     1561  SH_MUTEX_UNLOCK_UNSAFE(mutex_ticket);
     1562  SL_RETURN (retval, _("sl_create_ticket"));
    15521563}
    15531564
Note: See TracChangeset for help on using the changeset viewer.