Ignore:
Timestamp:
Mar 26, 2018, 10:25:56 PM (7 years ago)
Author:
bird
Message:

kmkbuiltin: funnel output thru output.c (usually via err.c).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/dir-nt-bird.c

    r3184 r3192  
    4040#endif
    4141#include <assert.h>
     42#include "kmkbuiltin.h"
     43#include "kmkbuiltin/err.h"
    4244
    4345#include "nt_fullpath.h" /* for the time being - will be implemented here later on. */
     
    730732
    731733
    732 int kmk_builtin_dircache(int argc, char **argv, char **envp)
     734int kmk_builtin_dircache(int argc, char **argv, char **envp, PKMKBUILTINCTX pCtx)
    733735{
    734736    assert(GetCurrentThreadId() == g_idMainThread);
     
    743745                return 0;
    744746            }
    745             fprintf(stderr, "kmk_builtin_dircache: the 'invalidate' command takes no arguments!\n");
     747            errx(pCtx, 2, "the 'invalidate' command takes no arguments!\n");
    746748        }
    747749        else if (strcmp(pszCmd, "invalidate-missing") == 0)
     
    752754                return 0;
    753755            }
    754             fprintf(stderr, "kmk_builtin_dircache: the 'invalidate-missing' command takes no arguments!\n");
     756            errx(pCtx, 2, "the 'invalidate-missing' command takes no arguments!\n");
    755757        }
    756758        else if (strcmp(pszCmd, "volatile") == 0)
     
    769771        }
    770772        else
    771             fprintf(stderr, "kmk_builtin_dircache: Invalid command '%s'!\n", pszCmd);
    772     }
    773     else
    774         fprintf(stderr, "kmk_builtin_dircache: No command given!\n");
     773            errx(pCtx, 2, "Invalid command '%s'!\n", pszCmd);
     774    }
     775    else
     776        errx(pCtx, 2, "No command given!\n");
    775777
    776778    K_NOREF(envp);
Note: See TracChangeset for help on using the changeset viewer.