while (1) -> for (;;)

This commit is contained in:
Kay Sievers 2010-05-27 15:11:00 +02:00
parent abbc1c17a0
commit 88cbfb09ee
13 changed files with 22 additions and 22 deletions

View file

@ -243,7 +243,7 @@ unsigned long long int udev_queue_get_udev_seqnum(struct udev_queue *udev_queue)
if (queue_file == NULL)
return 0;
while (1) {
for (;;) {
unsigned long long int seqnum;
ssize_t devpath_len;
@ -435,7 +435,7 @@ struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue *udev
if (queue_file == NULL)
return NULL;
while (1) {
for (;;) {
char syspath[UTIL_PATH_SIZE];
char *s;
size_t l;

View file

@ -84,7 +84,7 @@ int util_delete_path(struct udev *udev, const char *path)
if (pos == p || pos == NULL)
return 0;
while (1) {
for (;;) {
*pos = '\0';
pos = strrchr(p, '/');

View file

@ -242,7 +242,7 @@ static int test_monitor(struct udev *udev)
fd = udev_monitor_get_fd(udev_monitor);
FD_ZERO(&readfds);
while (1) {
for (;;) {
struct udev_device *device;
int fdcount;
@ -422,7 +422,7 @@ int main(int argc, char *argv[])
udev_set_log_fn(udev, log_fn);
printf("set log: %p\n", log_fn);
while (1) {
for (;;) {
int option;
option = getopt_long(argc, argv, "+dhV", options, NULL);

View file

@ -111,7 +111,7 @@ size_t udev_event_apply_format(struct udev_event *event, const char *src, char *
s = dest;
l = size;
while (1) {
for (;;) {
enum subst_type type = SUBST_UNKNOWN;
char attrbuf[UTIL_PATH_SIZE];
char *attr = NULL;

View file

@ -894,7 +894,7 @@ static int get_key(struct udev *udev, char **line, char **key, enum operation_ty
return -1;
*key = linepos;
while (1) {
for (;;) {
linepos++;
if (linepos[0] == '\0')
return -1;
@ -1180,7 +1180,7 @@ static int add_rule(struct udev_rules *rules, char *line,
rule_tmp.rule.rule.filename_line = lineno;
linepos = line;
while (1) {
for (;;) {
char *key;
char *value;
enum operation_type op;
@ -1707,7 +1707,7 @@ static int add_matching_files(struct udev *udev, struct udev_list_node *file_lis
return -1;
}
while (1) {
for (;;) {
struct dirent *dent;
dent = readdir(dir);
@ -1940,7 +1940,7 @@ static int match_key(struct udev_rules *rules, struct token *token, const char *
split = &rules->buf[token->key.value_off];
len = strlen(val);
while (1) {
for (;;) {
const char *next;
next = strchr(split, '|');
@ -2182,7 +2182,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
/* loop over parents */
event->dev_parent = event->dev;
while (1) {
for (;;) {
struct token *key;
dbg(event->udev, "parent: '%s'\n", udev_device_get_syspath(event->dev_parent));

View file

@ -66,7 +66,7 @@ int udevadm_control(struct udev *udev, int argc, char *argv[])
if (uctrl == NULL)
return 2;
while (1) {
for (;;) {
int option;
int i;
char *endp;

View file

@ -238,7 +238,7 @@ int udevadm_info(struct udev *udev, int argc, char *argv[])
QUERY_ALL,
} query = QUERY_NONE;
while (1) {
for (;;) {
int option;
struct stat statbuf;

View file

@ -92,7 +92,7 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[])
udev_list_init(&subsystem_match_list);
udev_list_init(&tag_match_list);
while (1) {
for (;;) {
option = getopt_long(argc, argv, "pekus:t:h", options, NULL);
if (option == -1)
break;

View file

@ -84,7 +84,7 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[])
sigaddset(&mask, SIGALRM);
sigprocmask(SIG_UNBLOCK, &mask, NULL);
while (1) {
for (;;) {
int option;
int seconds;
@ -181,7 +181,7 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[])
}
}
while (1) {
for (;;) {
struct stat statbuf;
const struct timespec duration = { 0 , 1000 * 1000 * 1000 / LOOP_PER_SECOND };

View file

@ -50,7 +50,7 @@ int udevadm_test(struct udev *udev, int argc, char *argv[])
info(udev, "version %s\n", VERSION);
while (1) {
for (;;) {
int option;
option = getopt_long(argc, argv, "a:s:fh", options, NULL);

View file

@ -122,7 +122,7 @@ int udevadm_trigger(struct udev *udev, int argc, char *argv[])
goto exit;
}
while (1) {
for (;;) {
int option;
const char *key;
const char *val;

View file

@ -146,7 +146,7 @@ int main(int argc, char *argv[])
udev_set_log_fn(udev, log_fn);
udev_selinux_init(udev);
while (1) {
for (;;) {
int option;
option = getopt_long(argc, argv, "+dhV", options, NULL);

View file

@ -536,7 +536,7 @@ static void events_start(struct udev *udev)
static void worker_returned(void)
{
while (1) {
for (;;) {
struct worker_message msg;
ssize_t size;
struct udev_list_node *loop;
@ -709,7 +709,7 @@ static void handle_signal(struct udev *udev, int signo)
udev_exit = true;
break;
case SIGCHLD:
while (1) {
for (;;) {
pid_t pid;
int status;
struct udev_list_node *loop, *tmp;
@ -975,7 +975,7 @@ int main(int argc, char *argv[])
info(udev, "version %s\n", VERSION);
udev_selinux_init(udev);
while (1) {
for (;;) {
int option;
option = getopt_long(argc, argv, "dDthV", options, NULL);