Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3F4319FDF for ; Sun, 20 Nov 2011 21:09:57 +0000 (UTC) Received: (qmail 52055 invoked by uid 500); 20 Nov 2011 21:09:57 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 52035 invoked by uid 500); 20 Nov 2011 21:09:56 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 52028 invoked by uid 99); 20 Nov 2011 21:09:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Nov 2011 21:09:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Nov 2011 21:09:53 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 859D323888FE for ; Sun, 20 Nov 2011 21:09:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1204266 - in /hadoop/common/branches/branch-0.20-security: CHANGES.txt src/c++/task-controller/impl/configuration.c src/c++/task-controller/test/test-task-controller.c Date: Sun, 20 Nov 2011 21:09:32 -0000 To: common-commits@hadoop.apache.org From: eli@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111120210932.859D323888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: eli Date: Sun Nov 20 21:09:31 2011 New Revision: 1204266 URL: http://svn.apache.org/viewvc?rev=1204266&view=rev Log: MAPREDUCE-2377. task-controller fails to parse configuration if it doesn't end in \n. Contributed by Todd Lipcon Modified: hadoop/common/branches/branch-0.20-security/CHANGES.txt hadoop/common/branches/branch-0.20-security/src/c++/task-controller/impl/configuration.c hadoop/common/branches/branch-0.20-security/src/c++/task-controller/test/test-task-controller.c Modified: hadoop/common/branches/branch-0.20-security/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/CHANGES.txt?rev=1204266&r1=1204265&r2=1204266&view=diff ============================================================================== --- hadoop/common/branches/branch-0.20-security/CHANGES.txt (original) +++ hadoop/common/branches/branch-0.20-security/CHANGES.txt Sun Nov 20 21:09:31 2011 @@ -43,6 +43,9 @@ Release 0.20.206.0 - unreleased HDFS-2541. For a sufficiently large value of blocks, the DN Scanner may request a random number with a negative seed value. (harsh via eli) + MAPREDUCE-2377. task-controller fails to parse configuration if it + doesn't end in \n. (todd via eli) + IMPROVEMENTS MAPREDUCE-2836. Provide option to fail jobs when submitted to Modified: hadoop/common/branches/branch-0.20-security/src/c++/task-controller/impl/configuration.c URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/src/c%2B%2B/task-controller/impl/configuration.c?rev=1204266&r1=1204265&r2=1204266&view=diff ============================================================================== --- hadoop/common/branches/branch-0.20-security/src/c++/task-controller/impl/configuration.c (original) +++ hadoop/common/branches/branch-0.20-security/src/c++/task-controller/impl/configuration.c Sun Nov 20 21:09:31 2011 @@ -155,8 +155,12 @@ void read_config(const char* file_name) break; } } - //trim the ending new line - line[strlen(line)-1] = '\0'; + + //trim the ending new line if there is one + if (line[strlen(line) - 1] == '\n') { + line[strlen(line)-1] = '\0'; + } + //comment line if(line[0] == '#') { free(line); Modified: hadoop/common/branches/branch-0.20-security/src/c++/task-controller/test/test-task-controller.c URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/src/c%2B%2B/task-controller/test/test-task-controller.c?rev=1204266&r1=1204265&r2=1204266&view=diff ============================================================================== --- hadoop/common/branches/branch-0.20-security/src/c++/task-controller/test/test-task-controller.c (original) +++ hadoop/common/branches/branch-0.20-security/src/c++/task-controller/test/test-task-controller.c Sun Nov 20 21:09:31 2011 @@ -97,7 +97,7 @@ int write_config_file(char *file_name) { fprintf(file, "," TEST_ROOT "/local-%d", i); } fprintf(file, "\n"); - fprintf(file, "hadoop.log.dir=" TEST_ROOT "/logs\n"); + fprintf(file, "hadoop.log.dir=" TEST_ROOT "/logs"); fclose(file); return 0; }