[patch] opencvs: server fatal() calls report incorrect function names

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch] opencvs: server fatal() calls report incorrect function names

Igor Zinovik
        Hello, tech@ readers.

fatal() calls in server.c report incorrect function names.

P.S.  I have a hypothesis that opencvs developers does not use
`__func__' macro, because it is not portable.  Is this true?

--- server.c.orig Mon Jan 28 03:28:15 2008
+++ server.c Mon Jan 28 03:41:47 2008
@@ -554,7 +554,8 @@ cvs_server_commit(char *data)
 
 void
 cvs_server_checkout(char *data)
-{ if (chdir(server_currentdir) == -1)
+{
+ if (chdir(server_currentdir) == -1)
  fatal("cvs_server_checkout: %s", strerror(errno));
 
  cvs_cmdop = CVS_OP_CHECKOUT;
@@ -575,8 +576,9 @@ cvs_server_diff(char *data)
 
 void
 cvs_server_export(char *data)
-{ if (chdir(server_currentdir) == -1)
- fatal("cvs_server_checkout: %s", strerror(errno));
+{
+ if (chdir(server_currentdir) == -1)
+ fatal("cvs_server_export: %s", strerror(errno));
 
  cvs_cmdop = CVS_OP_EXPORT;
  cvs_checkout(server_argc, server_argv);
@@ -670,7 +672,7 @@ void
 cvs_server_rtag(char *data)
 {
  if (chdir(current_cvsroot->cr_dir) == -1)
- fatal("cvs_server_rlog: %s", strerror(errno));
+ fatal("cvs_server_rtag: %s", strerror(errno));
 
  cvs_cmdop = CVS_OP_RTAG;
  cvs_tag(server_argc, server_argv);

Reply | Threaded
Open this post in threaded view
|

Re: [patch] opencvs: server fatal() calls report incorrect function names

Bob Beck-4
* Igor Zinovik <[hidden email]> [2008-01-28 13:50]:
> Hello, tech@ readers.
>
> fatal() calls in server.c report incorrect function names.
       
        one fatal call does, that you have fixed - the rest of this
diff is formatting changes.

        -Bob


>
> P.S.  I have a hypothesis that opencvs developers does not use
> `__func__' macro, because it is not portable.  Is this true?
>
> --- server.c.orig Mon Jan 28 03:28:15 2008
> +++ server.c Mon Jan 28 03:41:47 2008
> @@ -554,7 +554,8 @@ cvs_server_commit(char *data)
>
> void
> cvs_server_checkout(char *data)
> -{ if (chdir(server_currentdir) == -1)
> +{
> + if (chdir(server_currentdir) == -1)
> fatal("cvs_server_checkout: %s", strerror(errno));
>
> cvs_cmdop = CVS_OP_CHECKOUT;
> @@ -575,8 +576,9 @@ cvs_server_diff(char *data)
>
> void
> cvs_server_export(char *data)
> -{ if (chdir(server_currentdir) == -1)
> - fatal("cvs_server_checkout: %s", strerror(errno));
> +{
> + if (chdir(server_currentdir) == -1)
> + fatal("cvs_server_export: %s", strerror(errno));
>
> cvs_cmdop = CVS_OP_EXPORT;
> cvs_checkout(server_argc, server_argv);
> @@ -670,7 +672,7 @@ void
> cvs_server_rtag(char *data)
> {
> if (chdir(current_cvsroot->cr_dir) == -1)
> - fatal("cvs_server_rlog: %s", strerror(errno));
> + fatal("cvs_server_rtag: %s", strerror(errno));
>
> cvs_cmdop = CVS_OP_RTAG;
> cvs_tag(server_argc, server_argv);
>

--
#!/usr/bin/perl
if ((not 0 && not 1) !=  (! 0 && ! 1)) {
   print "Larry and Tom must smoke some really primo stuff...\n";
}

Reply | Threaded
Open this post in threaded view
|

Re: [patch] opencvs: server fatal() calls report incorrect function names

Matthew Dempsky-3
On 1/28/08, Bob Beck <[hidden email]> wrote:
>         one fatal call does,

I count two.

Reply | Threaded
Open this post in threaded view
|

Re: [patch] opencvs: server fatal() calls report incorrect function names

patrick keshishian
On Jan 28, 2008 3:48 PM, Matthew Dempsky <[hidden email]> wrote:
> On 1/28/08, Bob Beck <[hidden email]> wrote:
> >         one fatal call does,
>
> I count two.


Is there any reason we are not using __FUNCTION__ like so:


--- /tmp/b      Mon Jan 28 19:22:22 2008
+++ /tmp/c      Mon Jan 28 19:22:48 2008
@@ -7,7 +7,7 @@
 -               fatal("cvs_server_checkout: %s", strerror(errno));
 +{
 +       if (chdir(server_currentdir) == -1)
-+               fatal("cvs_server_export: %s", strerror(errno));
++               fatal("%s: %s", __FUNCTION__, strerror(errno));

        cvs_cmdop = CVS_OP_EXPORT;
        cvs_checkout(server_argc, server_argv);
@@ -16,7 +16,7 @@
  {
        if (chdir(current_cvsroot->cr_dir) == -1)
 -               fatal("cvs_server_rlog: %s", strerror(errno));
-+               fatal("cvs_server_rtag: %s", strerror(errno));
++               fatal("%s: %s", __FUNCTION__, strerror(errno));

        cvs_cmdop = CVS_OP_RTAG;
        cvs_tag(server_argc, server_argv);

Reply | Threaded
Open this post in threaded view
|

Re: [patch] opencvs: server fatal() calls report incorrect function names

Thomas Pfaff-2
patrick keshishian wrote:
[...]
> Is there any reason we are not using __FUNCTION__ like so:
[...]
> ++               fatal("%s: %s", __FUNCTION__, strerror(errno));

Or __func__ which is at least defined by C99 (if that matters).