* mdocml: Merge schwarze@'s patch to allow uname() to fail without causing
@ 2010-12-05 15:49 kristaps
0 siblings, 0 replies; only message in thread
From: kristaps @ 2010-12-05 15:49 UTC (permalink / raw)
To: source
Log Message:
-----------
Merge schwarze@'s patch to allow uname() to fail without causing an exit.
Modified Files:
--------------
mdocml:
main.c
mandoc.h
mdoc_validate.c
Revision Data
-------------
Index: mdoc_validate.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_validate.c,v
retrieving revision 1.135
retrieving revision 1.136
diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.135 -r1.136
--- mdoc_validate.c
+++ mdoc_validate.c
@@ -2130,14 +2130,17 @@ post_os(POST_ARGS)
return(0);
}
#else /*!OSNAME */
- if (-1 == uname(&utsname))
- return(mdoc_nmsg(mdoc, n, MANDOCERR_UTSNAME));
+ if (uname(&utsname)) {
+ mdoc_nmsg(mdoc, n, MANDOCERR_UNAME);
+ mdoc->meta.os = mandoc_strdup("UNKNOWN");
+ return(post_prol(mdoc));
+ }
if (strlcat(buf, utsname.sysname, BUFSIZ) >= BUFSIZ) {
mdoc_nmsg(mdoc, n, MANDOCERR_MEM);
return(0);
}
- if (strlcat(buf, " ", 64) >= BUFSIZ) {
+ if (strlcat(buf, " ", BUFSIZ) >= BUFSIZ) {
mdoc_nmsg(mdoc, n, MANDOCERR_MEM);
return(0);
}
Index: mandoc.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -Lmandoc.h -Lmandoc.h -u -p -r1.27 -r1.28
--- mandoc.h
+++ mandoc.h
@@ -93,6 +93,7 @@ enum mandocerr {
MANDOCERR_NOSCOPE, /* no such block is open */
MANDOCERR_SCOPEREP, /* scope already open */
MANDOCERR_SCOPEEXIT, /* scope open on exit */
+ MANDOCERR_UNAME, /* uname(3) system call failed */
/* FIXME: merge following with MANDOCERR_ARGCOUNT */
MANDOCERR_NOARGS, /* macro requires line argument(s) */
MANDOCERR_NOBODY, /* macro requires body argument(s) */
@@ -117,7 +118,6 @@ enum mandocerr {
MANDOCERR_SOPATH, /* NOT IMPLEMENTED: .so with absolute path or ".." */
MANDOCERR_NODOCBODY, /* no document body */
MANDOCERR_NODOCPROLOG, /* no document prologue */
- MANDOCERR_UTSNAME, /* utsname system call failed */
MANDOCERR_MEM, /* static buffer exhausted */
MANDOCERR_MAX
};
Index: main.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/main.c,v
retrieving revision 1.116
retrieving revision 1.117
diff -Lmain.c -Lmain.c -u -p -r1.116 -r1.117
--- main.c
+++ main.c
@@ -170,6 +170,7 @@ static const char * const mandocerrs[MAN
"request scope close w/none open",
"scope already open",
"scope open on exit",
+ "uname(3) system call failed",
"macro requires line argument(s)",
"macro requires body argument(s)",
"macro requires argument(s)",
@@ -194,7 +195,6 @@ static const char * const mandocerrs[MAN
"NOT IMPLEMENTED: .so with absolute path or \"..\"",
"no document body",
"no document prologue",
- "utsname system call failed",
"static buffer exhausted",
};
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-12-05 15:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-05 15:49 mdocml: Merge schwarze@'s patch to allow uname() to fail without causing kristaps
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).