~ubuntu-branches/ubuntu/precise/torque/precise-updates

« back to all changes in this revision

Viewing changes to src/lib/Libnet/rm.c

  • Committer: Bazaar Package Importer
  • Author(s): Dominique Belhachemi
  • Date: 2010-05-17 20:56:46 UTC
  • mfrom: (0.1.3 sid) (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100517205646-yipvh4jq5n5n1kgo
Tags: 2.4.8+dfsg-5
install man pages together with their associated binaries (Closes: #581576)

Show diffs side-by-side

added added

removed removed

Lines of Context:
417
417
    ret = diswsi(stream, RM_PROTOCOL_VER);
418
418
 
419
419
    if (ret == DIS_SUCCESS)
 
420
      {
420
421
      ret = diswsi(stream, com);
 
422
      }
421
423
    }
422
424
 
423
425
  if (ret != DIS_SUCCESS)
500
502
  {
501
503
  int ret, num;
502
504
 
 
505
 
503
506
  num = disrsi(stream, &ret);
504
507
 
505
508
  if (ret != DIS_SUCCESS)
632
635
    return(-1);
633
636
    }
634
637
 
635
 
  ret = diswcs(stream, file, len);
 
638
    ret = diswcs(stream, file, len);
 
639
 
636
640
 
637
641
  if (ret != DIS_SUCCESS)
638
642
    {
701
705
 
702
706
  ret = diswcs(op->stream, line, strlen(line));
703
707
 
 
708
 
704
709
  if (ret != DIS_SUCCESS)
705
710
    {
706
711
#if defined(ECOMM)
878
883
    op->len = -1;
879
884
    }
880
885
 
 
886
 
881
887
  startline = disrst(stream, &ret);
882
888
 
883
889
  if (ret == DIS_EOF)
1045
1051
 
1046
1052
  struct timeval tv;
1047
1053
 
1048
 
  fd_set         fdset;
 
1054
  fd_set *FDSet;
 
1055
 
 
1056
  int MaxNumDescriptors = 0;
1049
1057
 
1050
1058
  pbs_errno = 0;
1051
1059
 
1052
1060
  flushreq();
1053
1061
 
1054
 
  FD_ZERO(&fdset);
 
1062
  MaxNumDescriptors = get_max_num_descriptors();
 
1063
  FDSet = (fd_set *)calloc(1,sizeof(char) * get_fdset_size());
1055
1064
 
1056
1065
#if RPP
1057
1066
  for (try = 0;try < 3;)
1060
1069
      {
1061
1070
      if ((op = findout(i)) != NULL)
1062
1071
        {
 
1072
        free(FDSet);
1063
1073
        return(i);
1064
1074
        }
1065
1075
 
1069
1079
        {
1070
1080
        pbs_errno = errno;
1071
1081
 
 
1082
        free(FDSet);
1072
1083
        return(-1);
1073
1084
        }
1074
1085
 
1084
1095
      {
1085
1096
      pbs_errno = errno;
1086
1097
 
 
1098
      free(FDSet);
1087
1099
      return(-1);
1088
1100
      }
1089
1101
    else
1090
1102
      {
1091
1103
 
1092
 
      FD_SET(rpp_fd, &fdset);
 
1104
                        FD_SET(rpp_fd, FDSet);
1093
1105
      tv.tv_sec = 5;
1094
1106
      tv.tv_usec = 0;
1095
 
      num = select(FD_SETSIZE, &fdset, NULL, NULL, &tv);
 
1107
                        num = select(FD_SETSIZE, FDSet, NULL, NULL, &tv);
1096
1108
 
1097
1109
      if (num == -1)
1098
1110
        {
1099
1111
        pbs_errno = errno;
1100
1112
        DBPRT(("%s: select %d %s\n", id, pbs_errno, pbs_strerror(pbs_errno)))
 
1113
        free(FDSet);
1101
1114
        return -1;
1102
1115
        }
1103
1116
 
1110
1123
      }
1111
1124
    }
1112
1125
 
 
1126
  free(FDSet);
1113
1127
  return i;
1114
1128
 
1115
1129
#else
1124
1138
 
1125
1139
    while (op)
1126
1140
      {
1127
 
      FD_SET(op->stream, &fdset);
 
1141
                        FD_SET(op->stream, FDSet);
1128
1142
      op = op->next;
1129
1143
      }
1130
1144
    }
1132
1146
  tv.tv_sec = 15;
1133
1147
 
1134
1148
  tv.tv_usec = 0;
1135
 
  num = select(FD_SETSIZE, &fdset, NULL, NULL, &tv);
 
1149
 
 
1150
  num = select(MaxNumDescriptors, FDSet, NULL, NULL, &tv);
1136
1151
 
1137
1152
  if (num == -1)
1138
1153
    {
1139
1154
    pbs_errno = errno;
1140
1155
    DBPRT(("%s: select %d %s\n", id, pbs_errno, pbs_strerror(pbs_errno)))
 
1156
    free(FDSet);
1141
1157
    return -1;
1142
1158
    }
1143
1159
  else if (num == 0)
1144
 
    return -2;
 
1160
    {
 
1161
    free(FDSet);
 
1162
                return -2;
 
1163
    }
1145
1164
 
1146
1165
  for (i = 0; i < HASHOUT; i++)
1147
1166
    {
1152
1171
 
1153
1172
    while (op)
1154
1173
      {
1155
 
      if (FD_ISSET(op->stream, &fdset))
1156
 
        return op->stream;
 
1174
                        if (FD_ISSET(op->stream, FDSet))
 
1175
        {
 
1176
        free(FDSet);
 
1177
                                return op->stream;
 
1178
        }
1157
1179
 
1158
1180
      op = op->next;
1159
1181
      }
1160
1182
    }
1161
1183
 
 
1184
  free(FDSet);
1162
1185
  return(-2);
1163
1186
 
1164
1187
#endif