Add -x option. This causes pccardd to exit after probing the cards. This

is useful for low memory systems.

PR: 36418
Submitted by: Forrest W. Christian
This commit is contained in:
imp 2002-09-29 23:00:11 +00:00
parent b03c6fa493
commit fd3bf3a364
2 changed files with 14 additions and 2 deletions

View File

@ -35,6 +35,7 @@
.Nm
.Op Fl d
.Op Fl v
.Op Fl x
.Op Fl z
.Op Fl i Ar IRQ
.Op Fl I
@ -137,6 +138,14 @@ display error messages.
.It Fl v
After reading the configuration file, print out a summary
of it.
.It Fl x
Exits immediately after the cards have been probed and attached.
This is primarily useful in embedded applications where it is
desirable to use
.Nm
to start PC-CARD devices but prohibitive memory-wise to leave the
.Nm
process running.
.It Fl z
Delays running as a daemon until after the cards have been probed and attached.
.It Fl I

View File

@ -156,12 +156,13 @@ main(int argc, char *argv[])
{
struct slot *sp;
int count, dodebug = 0;
int probeonly = 0;
int delay = 0;
int irq_arg[16];
int irq_specified = 0;
int i;
struct sockaddr_un sun;
#define COM_OPTS ":Idvf:s:i:z"
#define COM_OPTS ":Idf:i:s:vxz"
bzero(irq_arg, sizeof(irq_arg));
use_kern_irq = 1;
@ -224,12 +225,14 @@ main(int argc, char *argv[])
if (doverbose)
dump_config_file();
log_setup();
if (!dodebug && !delay)
if (!dodebug && !delay && !probeonly)
if (daemon(0, 0))
die("fork failed");
slots = readslots();
if (slots == 0)
die("no PC-CARD slots");
if (probeonly)
exit(0);
if (delay)
if (daemon(0, 0))
die("fork failed");