Changeset 2991 for trunk/src


Ignore:
Timestamp:
Nov 1, 2016, 10:56:13 PM (9 years ago)
Author:
bird
Message:

tstNtFts: also compile against old code.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/Makefile.kmk

    r2912 r2991  
    532532tstFileInfo_SOURCES = w32/tstFileInfo.c
    533533
     534#
     535# tstFileInfo
     536#
     537PROGRAMS.win += tstFtsFake
     538tstFtsFake_TEMPLATE = BIN-KMK
     539tstFtsFake_NOINST = 1
     540tstFtsFake_DEFS = USE_OLD_FTS
     541tstFtsFake_SOURCES = ../lib/nt/tstNtFts.c
     542
     543
    534544
    535545include $(FILE_KBUILD_SUB_FOOTER)
  • trunk/src/lib/nt/tstNtFts.c

    r2989 r2991  
    44*   Header Files                                                                                                                 *
    55*********************************************************************************************************************************/
    6 #include "fts-nt.h"
     6#ifndef USE_OLD_FTS
     7# include "fts-nt.h"
     8#else
     9# include "kmkbuiltin/ftsfake.h"
     10#endif
    711#include <stdlib.h>
    812#include <stdio.h>
     
    3438           "  -x, --one-file-system\n"
    3539           "    FTS_XDEV\n"
     40           "  -q, --quiet\n"
     41           "    Quiet operation, no output.\n"
     42           "  -v, --verbose\n"
     43           "    Verbose operation (default).\n"
    3644           );
    3745    return 0;
     
    8795                else if (strcmp(pszArg, "one-file-system") == 0)
    8896                    chOpt = 'x';
     97                else if (strcmp(pszArg, "quiet") == 0)
     98                    chOpt = 'q';
     99                else if (strcmp(pszArg, "verbose") == 0)
     100                    chOpt = 'v';
    89101                else
    90102                {
     
    92104                    return 2;
    93105                }
     106                pszArg = "";
    94107            }
    95108            do
     
    132145                        break;
    133146
     147                    case 'q':
     148                        cVerbosity = 0;
     149                        break;
    134150                    case 'v':
    135151                        cVerbosity++;
     
    146162            papszFtsArgs[cFtsArgs++] = pszArg;
    147163    }
     164
     165#ifdef USE_OLD_FTS
     166    if (papszFtsArgs[0] == NULL)
     167    {
     168        fprintf(stderr, "Nothing to do\n");
     169        return 1;
     170    }
     171#endif
    148172
    149173    /*
     
    181205                }
    182206
    183                 printf("%8s %s\n", pszState, pFtsEnt->fts_accpath);
     207                if (cVerbosity > 0)
     208                    printf("%8s %s\n", pszState, pFtsEnt->fts_accpath);
    184209                if (   pFtsEnt->fts_info == FTS_SL
    185210                    && pFtsEnt->fts_number == 0
Note: See TracChangeset for help on using the changeset viewer.