[LTP] [PATCH v2 7/7] sched/process.c: Remove useless TRUE FALSE definitions
Petr Vorel
pvorel@suse.cz
Fri Sep 10 15:08:20 CEST 2021
FALSE is not used at all and replace TRUE with 1 (there is no point
trying to use true from <stdbool.h> just for while).
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
testcases/kernel/sched/process_stress/process.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/testcases/kernel/sched/process_stress/process.c b/testcases/kernel/sched/process_stress/process.c
index b66908e7a..9075305e1 100644
--- a/testcases/kernel/sched/process_stress/process.c
+++ b/testcases/kernel/sched/process_stress/process.c
@@ -46,13 +46,6 @@
#define MAXBVAL 70
#define MAXDVAL 11
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
#ifdef DEBUG
#define prtln() printf("At line number: %d\n", __LINE__); \
fflush(NULL)
@@ -200,7 +193,7 @@ int send_message(int id, mtyp_t type, char *text)
strcpy(sndbuf.mtext, text);
sndbuf.mtyp = type;
- while (TRUE) {
+ while (1) {
rc = msgsnd(id, &sndbuf, sizeof(struct messagebuf), IPC_NOWAIT);
if (rc == -1 && errno == EAGAIN) {
debugout("msgqueue %d of mtyp %d not ready to send\n",
@@ -992,7 +985,7 @@ void messenger(void)
* Infinite loop used to receive error messages from children and
* to terminate process tree.
*/
- while (TRUE) {
+ while (1) {
rc = msgrcv(msgerr, &rcvbuf, sizeof(struct messagebuf), 0, 0);
if (rc == -1) {
switch (errno) {
--
2.33.0
More information about the ltp
mailing list