git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] mingw: cope with the Isilon network file system

From
MÅMartin Ågren <martin.agren@gmail.com>
Date
Apr 9, 2020, 10:57 UTC
Message-ID
<CAN0heSrvZb3z3JdYSXs4Dy4nBwPYBAQZ5Zf2f9RSeUnyQSLeeg@mail.gmail.com>
In-Reply-To
<pull.756.git.git.1586427853403.gitgitgadget@gmail.com>

On Thu, 9 Apr 2020 at 12:26, Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com> wrote:

Show 5 quoted lines
>         handle = CreateFileW(wfilename, FILE_APPEND_DATA,
>                         FILE_SHARE_WRITE | FILE_SHARE_READ,
>                         NULL, create, FILE_ATTRIBUTE_NORMAL, NULL);
> -       if (handle == INVALID_HANDLE_VALUE)
> -               return errno = err_win_to_posix(GetLastError()), -1;

(This code, which is being removed, used "," to avoid having to introduce braces. There's another instance of this pattern a bit above.)

> +       if (handle == INVALID_HANDLE_VALUE) {
(Adding a brace here.)
Show 5 quoted lines
> +               DWORD err = GetLastError();
> +               /*
> +                * Some network storage solutions (e.g. Isilon) might return
> +                * ERROR_INVALID_PARAMETER instead of expected error
> +                * ERROR_PATH_NOT_FOUND, which results in a unknow error. If

s/ a / an / s/unknow/&n/

> +                * so, the error is now forced to be an ERROR_PATH_NOT_FOUND
> +                * error instead.
> +                */

"is now forced" sounds more like it describes this change/commit, rather than this piece of code. Maybe this final sentence can be scrapped entirely, since the forcing/translating/mapping is obvious from the code anyway? The remainder of the comment goes into *why* and looks more useful. Just my 2 cents.

> +               if (err == ERROR_INVALID_PARAMETER)
> +                       err = ERROR_PATH_NOT_FOUND;
> +               return errno = err_win_to_posix(err), -1;
> +       }

Now there's no need to avoid introducing braces, so maybe split this into two lines for a lower huh-factor?

  errno = err_win_to_posix(err);
  return -1;
Martin
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin
Message 2 of 5 in “mingw: cope with the Isilon network file system”
  1. mingw: cope with the Isilon network file systemJohannes Schindelin via GitGitGadget, Apr 9, 2020
  2. Martin ÅgrenApr 9, 2020
  3. Johannes SchindelinApr 9, 2020
  4. mingw: cope with the Isilon network file systemJohannes Schindelin via GitGitGadget, Apr 10, 2020
  5. Junio C HamanoApr 10, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.