diff options
author | Zelin Tong <ztong@ludwig.cs.unc.edu> | 2020-10-22 19:41:32 -0400 |
---|---|---|
committer | Zelin Tong <ztong@ludwig.cs.unc.edu> | 2020-10-22 19:41:32 -0400 |
commit | dca1ffeca10875a8516b80c8e78ebd47d92c855f (patch) | |
tree | 100fd9a1660ac4b7b4e5b4f7169893cde8737f89 | |
parent | 142eaff3b0ebb0a681f94832599af12549f809af (diff) |
Updated rt_launch to work with ext-res
-rw-r--r-- | bin/rt_launch.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/bin/rt_launch.c b/bin/rt_launch.c index f12af39..384ea64 100644 --- a/bin/rt_launch.c +++ b/bin/rt_launch.c | |||
@@ -123,24 +123,12 @@ int main(int argc, char** argv) | |||
123 | 123 | ||
124 | signal(SIGUSR1, SIG_IGN); | 124 | signal(SIGUSR1, SIG_IGN); |
125 | 125 | ||
126 | if (reservation == -1 || create_reservation) { | 126 | if (argc - optind < 3) |
127 | /* -r flag not given => wcet and period arguments required */ | 127 | usage("Arguments missing."); |
128 | if (argc - optind < 3) | ||
129 | usage("Arguments missing."); | ||
130 | |||
131 | wcet_ms = want_positive_double(argv[optind + 0], "BUDGET"); | ||
132 | period_ms = want_positive_double(argv[optind + 1], "PERIOD"); | ||
133 | optind += 2; | ||
134 | } else { | ||
135 | /* -r argument given: wcet and period are irrelevant | ||
136 | * since only the reservation parameters matter. */ | ||
137 | if (argc - optind < 1) | ||
138 | usage("Argument missing."); | ||
139 | 128 | ||
140 | /* pick dummy values */ | 129 | wcet_ms = want_positive_double(argv[optind + 0], "BUDGET"); |
141 | wcet_ms = 100; | 130 | period_ms = want_positive_double(argv[optind + 1], "PERIOD"); |
142 | period_ms = 100; | 131 | optind += 2; |
143 | } | ||
144 | 132 | ||
145 | wcet = ms2ns(wcet_ms); | 133 | wcet = ms2ns(wcet_ms); |
146 | period = ms2ns(period_ms); | 134 | period = ms2ns(period_ms); |