/***
This file is part of systemd.
Copyright 2008-2012 Kay Sievers <kay@vrfy.org>
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <getopt.h>
#include <stdio.h>
#include <unistd.h>
#include "libudev.h"
#include "stdio-util.h"
#include "string-util.h"
#include "udev-util.h"
#include "util.h"
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
const char *str;
int count;
count = 0;
count++;
}
if (count > 0)
count = 0;
printf("property: '%s=%s'\n",
count++;
}
if (count > 0)
printf("\n");
}
printf("no device found\n");
return -1;
}
return 0;
}
return -1;
printf("looking at parents\n");
do {
} while (device_parent != NULL);
printf("looking at parents again\n");
do {
} while (device_parent != NULL);
return 0;
}
return -1;
return 0;
}
printf("looking up device: 'block':'sda'\n");
return -1;
printf("looking up device: 'subsystem':'pci'\n");
return -1;
printf("looking up device: 'drivers':'scsi:sd'\n");
return -1;
printf("looking up device: 'module':'printk'\n");
return -1;
return 0;
}
int count = 0;
printf("device: '%s' (%s)\n",
count++;
}
}
return count;
}
int fd_ep;
if (fd_ep < 0) {
printf("error creating epoll fd: %m\n");
goto out;
}
if (udev_monitor == NULL) {
printf("no socket\n");
goto out;
}
printf("filter failed\n");
goto out;
}
if (udev_monitor_enable_receiving(udev_monitor) < 0) {
printf("bind failed\n");
goto out;
}
printf("fail to add fd to epoll: %m\n");
goto out;
}
printf("fail to add fd to epoll: %m\n");
goto out;
}
for (;;) {
int fdcount;
int i;
printf("waiting for events from udev, press ENTER to exit\n");
for (i = 0; i < fdcount; i++) {
printf("no device from socket\n");
continue;
}
printf("exiting loop\n");
goto out;
}
}
}
out:
if (fd_ep >= 0)
return 0;
}
if (udev_queue == NULL)
return -1;
printf("queue is empty\n");
return 0;
}
int r;
if (udev_enumerate == NULL)
return -1;
printf("enumerate 'net' + duplicated scan + null + zero\n");
if (udev_enumerate == NULL)
return -1;
printf("enumerate 'block'\n");
if (udev_enumerate == NULL)
return -1;
if (r < 0) {
return r;
}
printf("enumerate 'not block'\n");
if (udev_enumerate == NULL)
return -1;
printf("enumerate 'pci, mem, vc'\n");
if (udev_enumerate == NULL)
return -1;
printf("enumerate 'subsystem'\n");
if (udev_enumerate == NULL)
return -1;
printf("enumerate 'property IF_FS_*=filesystem'\n");
if (udev_enumerate == NULL)
return -1;
return 0;
}
printf("\n");
}
{}
};
int c;
printf("no context\n");
return 1;
}
switch (c) {
case 'p':
break;
case 's':
break;
case 'd':
if (log_get_max_level() < LOG_INFO)
break;
case 'h':
printf("--debug --syspath= --subsystem= --help\n");
goto out;
case 'V':
goto out;
case '?':
goto out;
default:
assert_not_reached("Unhandled option code.");
}
/* add sys path if needed */
}
out:
return 0;
}