Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
52774702
Commit
52774702
authored
Feb 11, 2006
by
Russ Fish
Browse files
Ignore the rude/crude priority option that is unsupported on Windows.
parent
9c15cefb
Changes
1
Hide whitespace changes
Inline
Side-by-side
tmcd/cygwinxp/c_rude.patch
View file @
52774702
***
crude/main.c
~
Thu Jun 13 06:15:21 2002
--- crude
/
main.c
Wed Nov
9
1
0:56:56
200
5
***
crude/main.c
.orig
Thu Jun 13 06:15:21 2002
--- crude
_
main.c
Thu Feb
2
1
7:18:17
200
6
***************
*** 35,42 ****
--- 35,44 ----
...
...
@@ -26,8 +26,23 @@
struct flow_stat *newflows;
***************
*** 205,212 ****
--- 209,220 ----
retval = -2;
}
if(user_id != 0){
+ #ifndef __CYGWIN__
fprintf(stderr,"crude: must be root to set the priority level\n");
retval = -2;
+ #else /* ifndef__CYGWIN__ */
+ fprintf(stderr,"crude: priority level is not supported on Cygwin\n");
+ #endif /* ifndef__CYGWIN__ */
}
} else {
RUDEBUG1("crude: invalid commandline arguments!\n");
***************
*** 288,293 ****
--- 29
2,298
----
--- 29
6,302
----
/* (if retval < 0 -> ERROR or/and EXIT IMMEDIATELY) */
if(retval < 0){ goto crude_exit; }
...
...
@@ -44,7 +59,7 @@
/* Activate the signal handler(s) */
memset(&action, 0, sizeof(struct sigaction));
--- 31
1
,3
18
----
--- 31
5
,3
22
----
goto crude_exit;
}
RUDEBUG7("crude: program priority set to %d\n", p.sched_priority);
...
...
@@ -55,7 +70,7 @@
memset(&action, 0, sizeof(struct sigaction));
***************
*** 332,337 ****
--- 3
38
,34
4
----
--- 3
42
,34
8
----
crude_exit:
if (retval >= 0 && nflows > 0) { ps_flag = 1; }
...
...
@@ -72,7 +87,7 @@
if(ps_flag){ print_stats(); }
if(main_file > 0){ close(main_file); }
--- 35
5
,36
2
----
--- 35
9
,36
6
----
/* Release the locked memory */
munlockall();
...
...
@@ -83,7 +98,7 @@
if(main_file > 0){ close(main_file); }
***************
*** 384,392 ****
--- 39
2
,40
3
----
--- 39
6
,40
7
----
*/
void crude_handler(int value)
{
...
...
@@ -105,7 +120,7 @@
if(nflows > 0){ print_stats(); }
if(main_file > 0){ close(main_file); }
--- 40
6
,41
3
----
--- 4
1
0,41
7
----
} else {
RUDEBUG7("crude_handler: crude priority restored\n");
}
...
...
@@ -129,8 +144,8 @@
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
***
rude/main.c
~
Thu Jun 13 06:15:21 2002
--- rude
/
main.c
Wed Nov
9
1
0:56:01
200
5
***
rude/main.c
.orig
Thu Jun 13 06:15:21 2002
--- rude
_
main.c
Thu Feb
2
1
7:18:19
200
6
***************
*** 31,42 ****
#include <string.h>
...
...
@@ -173,8 +188,23 @@
printf("rude version %s, Copyright (C) 1999 Juha Laine and Sampo Saaristo\n"
"rude comes with ABSOLUTELY NO WARRANTY!\n"
***************
*** 138,145 ****
--- 142,153 ----
retval = -2;
}
if(user_id != 0){
+ #ifndef __CYGWIN__
fprintf(stderr,"rude: must be root to set the priority level\n");
retval = -2;
+ #else /* ifndef__CYGWIN__ */
+ fprintf(stderr,"rude: priority level is not supported on Cygwin\n");
+ #endif /* ifndef__CYGWIN__ */
}
} else {
RUDEBUG1("rude: invalid commandline arguments!\n");
***************
*** 198,203 ****
--- 20
2
,2
08
----
--- 20
6
,2
12
----
goto rude_exit1;
}
...
...
@@ -184,7 +214,7 @@
* improve the performance... (the -P option)
***************
*** 217,222 ****
--- 22
2
,22
8
----
--- 22
6
,2
3
2 ----
}
RUDEBUG7("rude: program priority set to %d\n", p.sched_priority);
}
...
...
@@ -194,7 +224,7 @@
* All is fine - start looping & transmitting
***************
*** 229,234 ****
--- 23
5
,24
1
----
--- 23
9
,24
5
----
rude_exit:
...
...
@@ -204,7 +234,7 @@
*/
***************
*** 245,250 ****
--- 25
2
,2
58
----
--- 25
6
,2
62
----
/* Release the locked memory */
munlockall();
}
...
...
@@ -214,7 +244,7 @@
***************
*** 262,270 ****
--- 27
0
,28
1
----
--- 27
4
,28
5
----
void rude_handler(int value)
{
int ret_val = (value * (-1));
...
...
@@ -229,7 +259,7 @@
pri.sched_priority = 0;
***************
*** 276,281 ****
--- 2
87
,29
3
----
--- 2
91
,29
7
----
}
munlockall();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment