summaryrefslogtreecommitdiffstats
path: root/genrc.c
diff options
context:
space:
mode:
authorroot2009-07-05 22:14:21 +0200
committerroot2009-07-05 22:14:21 +0200
commite9bfe48fc5254e79e59c6ffc1698912175edf4e3 (patch)
tree63c13b3d019b9a45bcd1b48354e243f133292401 /genrc.c
parentChanged GSM api to current development tree of OpenBSC. (diff)
downloadlcr-e9bfe48fc5254e79e59c6ffc1698912175edf4e3.tar.gz
lcr-e9bfe48fc5254e79e59c6ffc1698912175edf4e3.tar.xz
lcr-e9bfe48fc5254e79e59c6ffc1698912175edf4e3.zip
Source cleanup.
modified: bootstrap.c modified: cause.c modified: crypt.cpp modified: endpoint.cpp modified: genext.c modified: genrc.c modified: gentones.c modified: genwave.c modified: ie.cpp modified: join.cpp modified: joinpbx.cpp modified: joinremote.cpp modified: lcradmin.c modified: mail.c modified: main.c modified: message.c modified: route.c modified: socket_server.c modified: tones.c modified: trace.c modified: vbox.cpp
Diffstat (limited to 'genrc.c')
-rw-r--r--genrc.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/genrc.c b/genrc.c
index e5b998a..3e349f4 100644
--- a/genrc.c
+++ b/genrc.c
@@ -43,17 +43,14 @@ int main(void)
printf("\n\nThis program generates a script, which is used to start/stop/restart mISDN\n");
printf("driver. Please select card only once. Mode and options are given by LCR.\n");
- while(1)
- {
+ while(1) {
printf("\nSelect %sdriver for cards:\n\n", i?"another ":"");
jj = 0;
- while(cards[jj].name)
- {
+ while(cards[jj].name) {
printf(" (%d) %s\n", jj+1, cards[jj].name);
jj++;
}
- do
- {
+ do {
printf("\nSelect driver number[1-n] (or enter 'done'): "); fflush(stdout);
scanf("%s", input);
} while (atoi(input) <= 0 && !!strcmp(input, "done"));
@@ -63,8 +60,7 @@ int main(void)
break;
}
- if (!i)
- {
+ if (!i) {
printf("\nNo cards defined!\n");
return(-1);
}
@@ -95,8 +91,7 @@ int main(void)
printf("\n\nFinally tell me where to write the mISDN rc file.\nEnter the name 'mISDN' for current directory.\nYou may want to say '/usr/local/lcr/mISDN' or '/etc/rc.d/mISDN'\n: "); fflush(stdout);
scanf("%s", file);
- if (!(fp=fopen(file, "w")))
- {
+ if (!(fp=fopen(file, "w"))) {
fprintf(stderr, "\nError: Failed to open '%s', try again.\n", file);
exit(EXIT_FAILURE);
}
@@ -106,11 +101,9 @@ int main(void)
fprintf(fp, "\t\t%s %smISDN_core%s debug=0x%x\n", input[0]?"insmod -f":"modprobe --ignore-install", input, input[0]?".ko":"", coredebug);
fprintf(fp, "\t\t%s %smISDN_dsp%s debug=0x%x options=0x%x\n", input[0]?"insmod -f":"modprobe --ignore-install", input, input[0]?".ko":"", dspdebug, lawopt);
j = 0;
- while(cards[j].name)
- {
+ while(cards[j].name) {
jj = 0;
- while (jj < n)
- {
+ while (jj < n) {
if (type[jj] == j+1)
fprintf(fp, "\t\t%s %s%s%s debug=0x%x\n", input[0]?"insmod -f":"modprobe --ignore-install", input, cards[j].module, input[0]?".ko":"", carddebug);
jj++;
@@ -120,12 +113,10 @@ int main(void)
fprintf(fp, "\t\tsleep 1\n");
fprintf(fp, "\t\t;;\n\n");
fprintf(fp, "\tstop|--stop)\n");
- while(j)
- {
+ while(j) {
j--;
jj = 0;
- while (jj < n)
- {
+ while (jj < n) {
if (type[jj] == j+1)
fprintf(fp, "\t\trmmod %s\n", cards[j].module);
jj++;