-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrrc.c
More file actions
35 lines (31 loc) · 851 Bytes
/
rrc.c
File metadata and controls
35 lines (31 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*========================================
* rrc.c: rrc (return return code) command version 1.0.0
* Copyright 2023
* Hiroyuki Kikuchi ([email protected])
* Last Modified: 2023/01/05
*========================================
*/
/* rrc version 1.0.0 : the first release. */
/* by Hiroyuki Kikuchi 2023/01/05 */
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int ret = 0;
if (argc == 1)
{
// no arguments
ret = EXIT_SUCCESS;
}
else if (argc > 2)
{
printf("too many arguments. 0 or 1 argument(s) are required.\n");
ret = EXIT_FAILURE;
}
else
{
ret = atoi(argv[1]);
}
printf("exit code: %d\n", ret);
exit(ret);
}