/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugin-runner.c

  • Committer: Teddy Hogeborn
  • Date: 2016-02-28 16:18:14 UTC
  • mfrom: (237.4.63 release)
  • Revision ID: teddy@recompile.se-20160228161814-tu6d4uw6oruqc5eo
Merge from release branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
891
891
    return 1;
892
892
  }
893
893
  
 
894
#ifdef __GLIBC__
 
895
#if __GLIBC_PREREQ(2, 15)
894
896
  int numplugins = scandirat(dir_fd, ".", &direntries, good_name,
895
897
                             alphasort);
 
898
#else  /* not __GLIBC_PREREQ(2, 15) */
 
899
  int numplugins = scandir(plugindir != NULL ? plugindir : PDIR,
 
900
                           &direntries, good_name, alphasort);
 
901
#endif  /* not __GLIBC_PREREQ(2, 15) */
 
902
#else   /* not __GLIBC__ */
 
903
  int numplugins = scandir(plugindir != NULL ? plugindir : PDIR,
 
904
                           &direntries, good_name, alphasort);
 
905
#endif  /* not __GLIBC__ */
896
906
  if(numplugins == -1){
897
907
    error(0, errno, "Could not scan plugin dir");
898
908
    direntries = NULL;
1104
1114
      goto fallback;
1105
1115
    }
1106
1116
    
1107
 
    FD_SET(new_plugin->fd, &rfds_all);
 
1117
#if defined (__GNUC__) and defined (__GLIBC__)
 
1118
#if not __GLIBC_PREREQ(2, 16)
 
1119
#pragma GCC diagnostic push
 
1120
#pragma GCC diagnostic ignored "-Wsign-conversion"
 
1121
#endif
 
1122
#endif
 
1123
    FD_SET(new_plugin->fd, &rfds_all); /* Spurious warning from
 
1124
                                          -Wconversion in GNU libc
 
1125
                                          before 2.16 */
 
1126
#if defined (__GNUC__) and defined (__GLIBC__)
 
1127
#if not __GLIBC_PREREQ(2, 16)
 
1128
#pragma GCC diagnostic pop
 
1129
#endif
 
1130
#endif
1108
1131
    
1109
1132
    if(maxfd < new_plugin->fd){
1110
1133
      maxfd = new_plugin->fd;
1166
1189
          }
1167
1190
          
1168
1191
          /* Remove the plugin */
1169
 
          FD_CLR(proc->fd, &rfds_all);
 
1192
#if defined (__GNUC__) and defined (__GLIBC__)
 
1193
#if not __GLIBC_PREREQ(2, 16)
 
1194
#pragma GCC diagnostic push
 
1195
#pragma GCC diagnostic ignored "-Wsign-conversion"
 
1196
#endif
 
1197
#endif
 
1198
          FD_CLR(proc->fd, &rfds_all); /* Spurious warning from
 
1199
                                          -Wconversion in GNU libc
 
1200
                                          before 2.16 */
 
1201
#if defined (__GNUC__) and defined (__GLIBC__)
 
1202
#if not __GLIBC_PREREQ(2, 16)
 
1203
#pragma GCC diagnostic pop
 
1204
#endif
 
1205
#endif
1170
1206
          
1171
1207
          /* Block signal while modifying process_list */
1172
1208
          ret = (int)TEMP_FAILURE_RETRY(sigprocmask
1212
1248
      }
1213
1249
      
1214
1250
      /* This process has not completed.  Does it have any output? */
1215
 
      if(proc->eof or not FD_ISSET(proc->fd, &rfds)){
 
1251
#if defined (__GNUC__) and defined (__GLIBC__)
 
1252
#if not __GLIBC_PREREQ(2, 16)
 
1253
#pragma GCC diagnostic push
 
1254
#pragma GCC diagnostic ignored "-Wsign-conversion"
 
1255
#endif
 
1256
#endif
 
1257
      if(proc->eof or not FD_ISSET(proc->fd, &rfds)){ /* Spurious
 
1258
                                                         warning from
 
1259
                                                         -Wconversion
 
1260
                                                         in GNU libc
 
1261
                                                         before
 
1262
                                                         2.16 */
 
1263
#if defined (__GNUC__) and defined (__GLIBC__)
 
1264
#if not __GLIBC_PREREQ(2, 16)
 
1265
#pragma GCC diagnostic pop
 
1266
#endif
 
1267
#endif
1216
1268
        /* This process had nothing to say at this time */
1217
1269
        proc = proc->next;
1218
1270
        continue;