static unsigned long
-try_to_find_unix_dev (unsigned long inode)
+try_to_find_unix_dev (ino_t inode)
{
UNIX_CACHE *walk;
static void
-add_file (const char *path, unsigned long device, unsigned long inode,
+add_file (const char *path, dev_t device, ino_t inode,
pid_t pid, int ref)
{
struct stat st;
FILE_DSC *file, *next;
ITEM_DSC **item, *this;
- unsigned long mount_dev;
+ dev_t mount_dev;
if (device)
mount_dev = device;
static void
-add_other (ITEM_TYPE type, unsigned long mount_dev,
- unsigned long device, unsigned long inode, const char *path)
+add_other (ITEM_TYPE type, dev_t mount_dev,
+ dev_t device, ino_t inode, const char *path)
{
FILE_DSC *file, *next;
ITEM_DSC **item, *this;
FILE *file;
char line[MAX_LINE + 1];
int major, minor;
- unsigned long inode;
+ ino_t inode;
+ unsigned long long tmp_inode;
if (!(file = fopen (rel, "r")))
return;
while (fgets (line, MAX_LINE, file))
{
- if (sscanf (line, "%*s %*s %*s %x:%x %ld", &major, &minor, &inode) != 3)
+ if (sscanf (line, "%*s %*s %*s %x:%x %lld", &major, &minor, &tmp_inode) != 3)
continue;
- if (major || minor || inode)
- add_file (rel, MKDEV (major, minor), inode, pid, type);
+ if (major || minor || tmp_inode) {
+ inode = (ino_t)(tmp_inode);
+ add_file (rel, MKDEV (major, minor), inode, pid, type);
+ }
}
fclose (file);
}
address_match = 0;
for (here = s; here; here = next ? next + 1 : NULL)
{
- printf("here: %s\n", here);
next = strchr (here, ',');
if (next)
*next = 0;
}
for (walk = this_name_space->cache; walk; walk = walk->next)
if ((lcl_port == -1 || walk->lcl_port == lcl_port) &&
- (rmt_addr.ss_family = 0|| ( memcmp(
+ (rmt_addr.ss_family == 0 || ( memcmp(
&((struct sockaddr_in6*)&walk->rmt_addr)->sin6_addr,
&((struct sockaddr_in6*)&rmt_addr)->sin6_addr,
sizeof(struct in6_addr)) == 0) ) &&
#define PROC_BASE "/proc"
-#define MAX_NAMES (sizeof(unsigned long)*8)
+#define MAX_NAMES (int)(sizeof(unsigned long)*8)
-static int verbose = 0, exact = 0, interactive = 0, quiet =
- 0, wait_until_dead = 0, process_group = 0, user = 0, pidof;
-
+static int verbose = 0, exact = 0, interactive = 0,
+ quiet = 0, wait_until_dead = 0, process_group = 0,
+ ignore_case = 0, pidof;
static int
ask (char *name, pid_t pid)
{
if (length != COMM_LEN - 1 || name_len[j] < COMM_LEN - 1)
{
- if (strcmp (namelist[j], comm))
+ if (ignore_case == 1)
+ {
+ if (strcasecmp (namelist[j], comm))
+ continue;
+ }
+ else
+ {
+ if (strcmp(namelist[j], comm))
continue;
+ }
}
else if (got_long ? strcmp (namelist[j], command) :
strncmp (namelist[j], comm, COMM_LEN - 1))
fprintf (stderr, " killall -l, --list\n");
fprintf (stderr, " killall -V --version\n\n");
fprintf (stderr, " -e,--exact require exact match for very long names\n");
+ fprintf (stderr, " -I,--ignore-case- case insensitive process name match\n");
fprintf (stderr, " -g,--process-group kill process group instead of process\n");
fprintf (stderr, " -i,--interactive ask for confirmation before killing\n");
fprintf (stderr, " -l,--list list all known signal names\n");
struct option options[] = {
{"exact", 0, NULL, 'e'},
+ {"ignore-case", 0, NULL, 'I'},
{"process-group", 0, NULL, 'g'},
{"interactive", 0, NULL, 'i'},
{"list-signals", 0, NULL, 'l'},
opterr = 0;
#ifdef FLASK_LINUX
- while ( (optc = getopt_long_only(argc,argv,"egilqs:vwd:c:V",options,NULL)) != EOF) {
+ while ( (optc = getopt_long_only(argc,argv,"egilqs:vwd:c:VI",options,NULL)) != EOF) {
#else
- while ( (optc = getopt_long_only(argc,argv,"egilqs:vwV",options,NULL)) != EOF) {
+ while ( (optc = getopt_long_only(argc,argv,"egilqs:vwVI",options,NULL)) != EOF) {
#endif
switch (optc) {
case 'e':
usage();
wait_until_dead = 1;
break;
+ case 'I':
+ ignore_case = 1;
+ break;
case 'V':
print_version();
return 0;