committed as 2408.

-Angus

On Wed, Sep 9, 2009 at 11:11 AM, Steven Dake<[email protected]> wrote:
> this patch looks better
>
> regards
> -steve
>
> On Wed, 2009-09-09 at 11:11 +1200, Angus Salkeld wrote:
>> On Wed, Sep 9, 2009 at 7:49 AM, Steven Dake<[email protected]> wrote:
>> > good for merge
>> >
>> > regards
>> > -steve
>> >
>>
>> Steve here is a patch that will only do this if needed.
>>
>> Index: exec/logsys.c
>> ===================================================================
>> --- exec/logsys.c     (revision 2407)
>> +++ exec/logsys.c     (working copy)
>> @@ -1303,6 +1303,7 @@
>>       unsigned int len;
>>       unsigned int level;
>>       int subsysid;
>> +     char * short_file_name;
>>
>>       subsysid = LOGSYS_DECODE_SUBSYSID(rec_ident);
>>       level = LOGSYS_DECODE_LEVEL(rec_ident);
>> @@ -1318,6 +1319,15 @@
>>               logsys_print_buffer[len - 1] = '\0';
>>               len -= 1;
>>       }
>> +#ifdef BUILDING_IN_PLACE
>> +     short_file_name = file_name;
>> +#else
>> +     short_file_name = strrchr (file_name, '/');
>> +     if (short_file_name == NULL)
>> +             short_file_name = file_name;
>> +     else
>> +             short_file_name++; /* move past the "/" */
>> +#endif /* BUILDING_IN_PLACE */
>>
>>       /*
>>        * Create a log record
>> @@ -1325,7 +1335,7 @@
>>       _logsys_log_rec (
>>               rec_ident,
>>               function_name,
>> -             file_name,
>> +             short_file_name,
>>               file_line,
>>               logsys_print_buffer, len + 1,
>>               LOGSYS_REC_END);
>> @@ -1336,7 +1346,7 @@
>>                * expect the worker thread to output the log data once 
>> signaled
>>                */
>>               log_printf_to_logs (rec_ident,
>> -                                 file_name, function_name, file_line,
>> +                                 short_file_name, function_name, file_line,
>>                                   logsys_print_buffer);
>>       } else {
>>               /*
>> Index: configure.ac
>> ===================================================================
>> --- configure.ac      (revision 2407)
>> +++ configure.ac      (working copy)
>> @@ -41,6 +41,13 @@
>>       fi
>>  fi
>>
>> +if test "$srcdir" = "."; then
>> +     AC_MSG_NOTICE([building in place srcdir:$srcdir])
>> +     AC_DEFINE([BUILDING_IN_PLACE], 1, [building in place])
>> +else
>> +     AC_MSG_NOTICE([building out of tree srcdir:$srcdir])
>> +fi
>> +
>>  # Checks for programs.
>>
>>  # check stolen from gnulib/m4/gnu-make.m4
>> _______________________________________________
>> Openais mailing list
>> [email protected]
>> https://lists.linux-foundation.org/mailman/listinfo/openais
>
>
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to