blob: d183d9183338d9e3e7d2618a5ef302518bd5c7e8 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001Upstream-Status: Inappropriate [1]
2
3[1] Not the author, the patch is from:
4http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
5
6--- rdist-6.1.5/src/message.c.thestokes 2006-04-19 17:30:39.000000000 -0400
7+++ rdist-6.1.5/src/message.c 2006-04-19 17:36:37.000000000 -0400
8@@ -793,15 +793,20 @@
9 char *msg;
10 {
11 static char buf[MSGBUFSIZ];
12-
13- ++nerrs;
14-
15- if (isserver)
16- (void) sprintf(buf, "REMOTE ERROR: %s", msg);
17- else
18- (void) sprintf(buf, "LOCAL ERROR: %s", msg);
19-
20- _message(MT_FERROR, buf);
21+ /* Don't reenter this function. There is a nasty infinite recursion
22+ case that pops up when msgsndnotify tries to exit. */
23+ static int inside=0;
24+
25+ if(inside==0){
26+ ++nerrs;
27+ inside=1;
28+
29+ if (isserver)
30+ (void) sprintf(buf, "REMOTE ERROR: %s", msg);
31+ else
32+ (void) sprintf(buf, "LOCAL ERROR: %s", msg);
33+ _message(MT_FERROR, buf);
34+ }
35
36 exit(nerrs);
37 }