nginx / unit

NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
https://unit.nginx.org
Apache License 2.0
5.25k stars 321 forks source link

fs: Use a temporary variable for the return value #1231

Closed alejandro-colomar closed 2 months ago

alejandro-colomar commented 2 months ago

This avoids breaking a long line.

Cc: @ac000

alejandro-colomar commented 2 months ago

v2 changes:

$ git range-diff master gh/tmp tmp
1:  be380374 ! 1:  2419b055 Fs: Use a temporary variable for the return value
    @@ src/nxt_fs.c: static nxt_int_t nxt_fs_mkdir(const u_char *dir, mode_t mode);
     -    char    path[PATH_MAX];
     +    char       *start, *end, *dst;
     +    size_t     dirlen;
    -+    char       path[PATH_MAX];
     +    nxt_int_t  ret;
    ++    char       path[PATH_MAX];

          dirlen = nxt_strlen(dir);
alejandro-colomar commented 2 months ago

v2b changes:

$ git range-diff master gh/tmp tmp
1:  2419b055 ! 1:  69f56464 Fs: Use a temporary variable for the return value
    @@ Metadata
     Author: Alejandro Colomar <alx@kernel.org>

      ## Commit message ##
    -    Fs: Use a temporary variable for the return value
    +    Fs: use a temporary variable for the return value

         This avoids breaking a long line.
alejandro-colomar commented 2 months ago

v2c changes:

$ git range-diff master gh/tmp tmp
1:  69f56464 ! 1:  a5289501 Fs: use a temporary variable for the return value
    @@ Metadata
     Author: Alejandro Colomar <alx@kernel.org>

      ## Commit message ##
    -    Fs: use a temporary variable for the return value
    +    fs: Use a temporary variable for the return value

         This avoids breaking a long line.
alejandro-colomar commented 2 months ago

How did that test fail?

https://github.com/nginx/unit/actions/runs/8805812704/job/24169230155

This is too trivial to have broken anything. :D

ac000 commented 2 months ago

That's a common failure, I've set that job to run again...

ac000 commented 2 months ago

Bingo!

alejandro-colomar commented 2 months ago

Closing in favour of https://github.com/nginx/unit/pull/1235