Changeset 315 for trunk/src


Ignore:
Timestamp:
Mar 11, 2011, 8:30:55 PM (14 years ago)
Author:
katerina
Message:

Fix for ticket #236 (blocking on NFS mounts).

Location:
trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_calls.c

    r307 r315  
    5252#include "sh_calls.h"
    5353#include "sh_ipvx.h"
     54#include "sh_sub.h"
     55#include "sh_utils.h"
    5456
    5557#undef  FIL__
     
    240242}
    241243
     244static int sh_use_sub = 0;
     245
     246int sh_calls_set_sub (const char * str)
     247{
     248  return sh_util_flagval(str, &sh_use_sub);
     249}
     250
    242251long int retry_lstat(const char * file, int line,
    243252                     const char *file_name, struct stat *buf)
     
    249258  SL_ENTER(_("retry_lstat"));
    250259
    251   do {
    252     val_retry = /*@-unrecog@*/lstat (file_name, buf)/*@+unrecog@*/;
    253   } while (val_retry < 0 && errno == EINTR);
     260  if (sh_use_sub)
     261    {
     262      val_retry = sh_sub_lstat (file_name, buf);
     263    }
     264  else
     265    {
     266      do {
     267        val_retry = /*@-unrecog@*/lstat (file_name, buf)/*@+unrecog@*/;
     268      } while (val_retry < 0 && errno == EINTR);
     269    }
     270
    254271  error = errno;
    255272  if (val_retry < 0) {
     
    260277  }
    261278  errno = error;   
     279
    262280  SL_RETURN(val_retry, _("retry_lstat"));
    263281}
     
    272290  SL_ENTER(_("retry_stat"));
    273291
    274   do {
    275     val_retry = stat (file_name, buf);
    276   } while (val_retry < 0 && errno == EINTR);
     292  if (sh_use_sub)
     293    {
     294      val_retry = sh_sub_stat (file_name, buf);
     295    }
     296  else
     297    {
     298      do {
     299        val_retry = stat (file_name, buf);
     300      } while (val_retry < 0 && errno == EINTR);
     301    }
     302
    277303  error = errno;
    278304  if (val_retry < 0) {
     
    283309  }
    284310  errno = error;   
     311
    285312  SL_RETURN(val_retry, _("retry_stat"));
    286313}
  • trunk/src/sh_forward.c

    r307 r315  
    48624862  int flag   = 1; /* non-zero to enable an option */
    48634863
     4864  /* fprintf(stderr, "FIXME IPVX: bind addr %s (%d) :%d\n",
     4865          sh_ipvx_print_sockaddr (sa, domain), salen,
     4866          sh_ipvx_get_port(sa, domain)); */
     4867
    48644868  /* create the socket, bind() it and listen()
    48654869   */
     
    49404944      hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
    49414945      hints.ai_socktype = SOCK_STREAM;
     4946      hints.ai_family   = AF_UNSPEC;
    49424947      sl_snprintf(port, sizeof(port), "%d", server_port);
    49434948
  • trunk/src/sh_port2proc.c

    r298 r315  
    422422
    423423                sh_ipvx_ntoa(a, sizeof(a), &ss);
    424                 sh_ipvx_ntoa(b, sizeof(b), &ss);
     424                sh_ipvx_ntoa(b, sizeof(b), saddr);
    425425
    426426                fprintf(stderr, " -> inode %u, iface/port %s,%u, status %u, searching %s,%u, %u\n",
  • trunk/src/sh_pthread.c

    r259 r315  
    1515SH_MUTEX_INIT(mutex_readdir,      PTHREAD_MUTEX_INITIALIZER);
    1616SH_MUTEX_INIT(mutex_thread_nolog, PTHREAD_MUTEX_INITIALIZER);
     17
     18int sh_pthread_setsigmask(int how, const void *set, void *oldset)
     19{
     20  return pthread_sigmask(how, (const sigset_t *)set, (sigset_t *)oldset);
     21}
    1722
    1823void sh_pthread_mutex_unlock (void *arg)
     
    288293#endif
    289294
     295#else
     296
     297#include <signal.h>
     298
     299int sh_pthread_setsigmask(int how, const void *set, void *oldset)
     300{
     301  return sigprocmask(how, (const sigset_t *)set, (sigset_t *)oldset);
     302}
     303
    290304
    291305#endif
  • trunk/src/sh_readconf.c

    r310 r315  
    12271227    sh_util_sigtype },
    12281228
     1229  { N_("avoidblock"),     SH_SECTION_MISC,  SH_SECTION_NONE,
     1230    sh_calls_set_sub },
     1231
    12291232  { NULL,    0,   0,  NULL}
    12301233};
  • trunk/src/sh_socket.c

    r295 r315  
    683683      {
    684684        ++retry;
    685         retry_msleep(0, 1);
     685        retry_msleep(0, 10);
    686686      }
    687687  } while ((nbytes < 0) && (retry < 3));
  • trunk/src/sh_unix.c

    r310 r315  
    15291529  do {
    15301530    errno = 0;
    1531     test  = sigprocmask(SIG_UNBLOCK, &set_proc, NULL);
     1531    test  = SH_SETSIGMASK(SIG_UNBLOCK, &set_proc, NULL);
    15321532  } while (test < 0 && errno == EINTR);
    15331533
Note: See TracChangeset for help on using the changeset viewer.