/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 *     Copyright 2013 Couchbase, Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

#include <internal.h> /* getenv, sytem, snprintf */

int main(int argc, char *argv[])
{
#ifndef WIN32
    char *srcdir = getenv("srcdir");
    char command[FILENAME_MAX];
    int status;

    snprintf(command, FILENAME_MAX, "%s/tools/cbc version 2>&1", srcdir);
    status = system(command);
    if (status == -1 || WIFSIGNALED(status) || WEXITSTATUS(status) != 0) {
        return 1;
    }
    snprintf(command, FILENAME_MAX, "%s/tools/cbc help 2>&1", srcdir);
    if (status == -1 || WIFSIGNALED(status) || WEXITSTATUS(status) != 0) {
        return 1;
    }
#endif
    return 0;
}


/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 *     Copyright 2013 Couchbase, Inc.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

#include <internal.h> /* getenv, sytem, snprintf */

int main(void)
{
#ifndef WIN32
    char *srcdir = getenv("srcdir");
    char command[FILENAME_MAX];
    int status;

    snprintf(command, FILENAME_MAX, "%s/tools/cbc version 2>&1", srcdir);
    status = system(command);
    if (status == -1 || WIFSIGNALED(status) || WEXITSTATUS(status) != 0) {
        return 1;
    }
    snprintf(command, FILENAME_MAX, "%s/tools/cbc help 2>&1", srcdir);
    if (status == -1 || WIFSIGNALED(status) || WEXITSTATUS(status) != 0) {
        return 1;
    }
#endif
    return 0;
}


Fix compile error with -Werror
Fix compile error with -Werror

Change-Id: Ifac2f0b1c06534bc85bad5fe2b2594c4eb208dda
Reviewed-on: http://review.couchbase.org/27387
Tested-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com>
Reviewed-by: Sergey Avseyev <87f6d5e4fd3644c3c20800cde7fd3ad1569370b3@gmail.com>
