From owner-svn-src-all@FreeBSD.ORG Tue Mar 17 19:51:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BE941065670; Tue, 17 Mar 2009 19:51:04 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F51C8FC15; Tue, 17 Mar 2009 19:51:04 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2HJp4gn004810; Tue, 17 Mar 2009 19:51:04 GMT (envelope-from dwmalone@svn.freebsd.org) Received: (from dwmalone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2HJp4ER004808; Tue, 17 Mar 2009 19:51:04 GMT (envelope-from dwmalone@svn.freebsd.org) Message-Id: <200903171951.n2HJp4ER004808@svn.freebsd.org> From: David Malone Date: Tue, 17 Mar 2009 19:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189936 - head/release/picobsd/tinyware/simple_httpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2009 19:51:05 -0000 Author: dwmalone Date: Tue Mar 17 19:51:04 2009 New Revision: 189936 URL: http://svn.freebsd.org/changeset/base/189936 Log: Warns fixes: use putenv rather than setenv to avoid constness problems, when we want to print an off_t cast to intmax_t and use %jd. Up WARNS to 6. Modified: head/release/picobsd/tinyware/simple_httpd/Makefile head/release/picobsd/tinyware/simple_httpd/simple_httpd.c Modified: head/release/picobsd/tinyware/simple_httpd/Makefile ============================================================================== --- head/release/picobsd/tinyware/simple_httpd/Makefile Tue Mar 17 19:38:40 2009 (r189935) +++ head/release/picobsd/tinyware/simple_httpd/Makefile Tue Mar 17 19:51:04 2009 (r189936) @@ -3,5 +3,6 @@ PROG=simple_httpd SRCS= simple_httpd.c NO_MAN= +WARNS?=6 .include Modified: head/release/picobsd/tinyware/simple_httpd/simple_httpd.c ============================================================================== --- head/release/picobsd/tinyware/simple_httpd/simple_httpd.c Tue Mar 17 19:38:40 2009 (r189935) +++ head/release/picobsd/tinyware/simple_httpd/simple_httpd.c Tue Mar 17 19:51:04 2009 (r189936) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -278,7 +279,7 @@ http_request(void) /*printf("HTTP/1.0 200 OK\nContent-type: text/html\n\n\n");*/ printf("HTTP/1.0 200 OK\r\n"); /* Plug in environment variable, others in log_line */ - putenv("SERVER_SOFTWARE=FreeBSD/PicoBSD"); + setenv("SERVER_SOFTWARE", "FreeBSD/PicoBSD", 1); execlp (filename,filename,par,(char *)0); } @@ -331,7 +332,7 @@ http_request(void) http_output(httpd_server_ident); http_date(); - sprintf(buff, "Content-length: %lld\r\n", file_status.st_size); + sprintf(buff, "Content-length: %jd\r\n", (intmax_t)file_status.st_size); write(con_sock, buff, strlen(buff)); strcpy(buff, "Content-type: ");