Re: [PATCH 3/4] strncat.3 fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 13, 2023 at 02:15:20AM +0100, Alejandro Colomar wrote:
> > and by removing an unnecessary call to 'exit'.
> 
> This was practice from Michael Kerrisk, which I like: always terminate
> the program with exit(1); don't rely on just ending the scope of main().

D'oh!  I meant exit(3).  Since I need to write this email, I'll take the
opportunity to quote man-pages(7):

STYLE GUIDE
     ...

   Example programs and shell sessions
     Manual  pages  may  include example programs demonstrating how to
     use a system call or library function.  However, note the follow‐
     ing:

     ...

     •  For consistency, all example programs should  terminate  using
        either of:

            exit(EXIT_SUCCESS);
            exit(EXIT_FAILURE);

        Avoid using the following forms to terminate a program:

            exit(0);
            exit(1);
            return n;


Cheers,
Alex

> That way, it's more visual.
> 

-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux