udevadm-settle.c revision 8249e04e3e9b6054768c3cd0ef72544831672b47
/*
* Copyright (C) 2006-2008 Kay Sievers <kay@vrfy.org>
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <dirent.h>
#include <fcntl.h>
#include <syslog.h>
#include <getopt.h>
#include "udev.h"
#define DEFAULT_TIMEOUT 180
#define LOOP_PER_SECOND 20
{
{}
};
int timeout = DEFAULT_TIMEOUT;
struct udev_queue *udev_queue;
int loop;
int rc = 0;
while (1) {
int option;
int seconds;
if (option == -1)
break;
switch (option) {
case 't':
if (seconds > 0)
else
break;
case 'h':
printf("Usage: udevadm settle [--help] [--timeout=<seconds>]\n\n");
goto exit;
}
}
if (udev_queue == NULL)
goto exit;
while (loop--) {
break;
}
if (loop <= 0) {
struct udev_list_entry *list_entry;
printf(" '%s' [%s]\n",
rc = 1;
}
exit:
return rc;
}