{
            if (errno != ENOENT)
                ereport(ERROR,
-                       (errcode(errcode_for_file_access()),
+                       (errcode_for_file_access(),
                         errmsg("could not stat file or directory \"%s\": %m",
                                pathbuf)));
 
            MemSet(linkpath, 0, sizeof(linkpath));
            if (readlink(pathbuf, linkpath, sizeof(linkpath) - 1) == -1)
                ereport(ERROR,
-                       (errcode(errcode_for_file_access()),
+                       (errcode_for_file_access(),
                         errmsg("could not read symbolic link \"%s\": %m",
                                pathbuf)));
            if (!sizeonly)
    fp = AllocateFile(readfilename, "rb");
    if (fp == NULL)
        ereport(ERROR,
-               (errcode(errcode_for_file_access()),
+               (errcode_for_file_access(),
                 errmsg("could not open file \"%s\": %m", readfilename)));
 
    /*