Author: pjd
Date: Tue Oct 25 07:34:35 2011
New Revision: 226718
URL: http://svn.freebsd.org/changeset/base/226718

Log:
  If 'req' is NULL, print error on stderr.
  
  MFC after:    3 days

Modified:
  head/sbin/geom/misc/subr.c

Modified: head/sbin/geom/misc/subr.c
==============================================================================
--- head/sbin/geom/misc/subr.c  Tue Oct 25 07:32:43 2011        (r226717)
+++ head/sbin/geom/misc/subr.c  Tue Oct 25 07:34:35 2011        (r226718)
@@ -379,10 +379,15 @@ gctl_error(struct gctl_req *req, const c
 {
        va_list ap;
 
-       if (req->error != NULL)
+       if (req != NULL && req->error != NULL)
                return;
        va_start(ap, error);
-       vasprintf(&req->error, error, ap);
+       if (req != NULL) {
+               vasprintf(&req->error, error, ap);
+       } else {
+               vfprintf(stderr, error, ap);
+               fprintf(stderr, "\n");
+       }
        va_end(ap);
 }
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to