/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 20:26:27 UTC
  • Revision ID: teddy@recompile.se-20160228202627-vls5dia6repq6ks2
Depend on the GNU C Library 2.16 or later 

* INSTALL: Document dependency.
* plugin-runner.c: Remove #ifdefs for scandirat() and adding of
                   -Wsign-conversion for FD_SET, FD_CLR, and FD_ISSET.
* plugins.d/mandos-client.c: - '' -

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)
896
894
  int numplugins = scandirat(dir_fd, ".", &direntries, good_name,
897
895
                             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__ */
906
896
  if(numplugins == -1){
907
897
    error(0, errno, "Could not scan plugin dir");
908
898
    direntries = NULL;
1114
1104
      goto fallback;
1115
1105
    }
1116
1106
    
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
 
1107
    FD_SET(new_plugin->fd, &rfds_all);
1131
1108
    
1132
1109
    if(maxfd < new_plugin->fd){
1133
1110
      maxfd = new_plugin->fd;
1189
1166
          }
1190
1167
          
1191
1168
          /* Remove the plugin */
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
 
1169
          FD_CLR(proc->fd, &rfds_all);
1206
1170
          
1207
1171
          /* Block signal while modifying process_list */
1208
1172
          ret = (int)TEMP_FAILURE_RETRY(sigprocmask
1248
1212
      }
1249
1213
      
1250
1214
      /* This process has not completed.  Does it have any output? */
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
 
1215
      if(proc->eof or not FD_ISSET(proc->fd, &rfds)){
1268
1216
        /* This process had nothing to say at this time */
1269
1217
        proc = proc->next;
1270
1218
        continue;