From owner-svn-src-stable@FreeBSD.ORG Sun Mar 3 19:20:31 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2D99B1C7; Sun, 3 Mar 2013 19:20:31 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 070CF36C; Sun, 3 Mar 2013 19:20:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23JKUY3054745; Sun, 3 Mar 2013 19:20:30 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23JKUUx054728; Sun, 3 Mar 2013 19:20:30 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201303031920.r23JKUUx054728@svn.freebsd.org> From: Devin Teske Date: Sun, 3 Mar 2013 19:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247727 - stable/9/usr.sbin/tzsetup X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 19:20:31 -0000 Author: dteske Date: Sun Mar 3 19:20:30 2013 New Revision: 247727 URL: http://svnweb.freebsd.org/changeset/base/247727 Log: MFC r230299: Fix #ifdef VERBOSE for UTC case Update verbose output to match what actually happens when selecting the UTC option, and when the -n option is used. Patch updated slightly for new libdialog. PR: bin/164042 Submitted by: dteske Modified: stable/9/usr.sbin/tzsetup/tzsetup.c Modified: stable/9/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/9/usr.sbin/tzsetup/tzsetup.c Sun Mar 3 19:12:07 2013 (r247726) +++ stable/9/usr.sbin/tzsetup/tzsetup.c Sun Mar 3 19:20:30 2013 (r247727) @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD$"); #include #include @@ -659,16 +659,19 @@ install_zoneinfo_file(const char *zonein copymode = 1; #ifdef VERBOSE - if (copymode) + snprintf(title, sizeof(title), "Info"); + if (zoneinfo_file == NULL) + snprintf(prompt, sizeof(prompt), + "Removing %s", path_localtime); + else if (copymode) snprintf(prompt, sizeof(prompt), "Copying %s to %s", zoneinfo_file, path_localtime); else snprintf(prompt, sizeof(prompt), "Creating symbolic link %s to %s", - path_localtime, - zoneinfo_file == NULL ? "(UTC)" : zoneinfo_file); + path_localtime, zoneinfo_file); if (usedialog) - dialog_notify(prompt); + dialog_msgbox(title, prompt, 8, 72, 1); else fprintf(stderr, "%s\n", prompt); #endif @@ -699,6 +702,10 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } +#ifdef VERBOSE + snprintf(prompt, sizeof(prompt), + "Removed %s", path_localtime); +#endif return (DITEM_LEAVE_MENU); } @@ -797,23 +804,23 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } } - } #ifdef VERBOSE - snprintf(title, sizeof(title), "Done"); - if (copymode) - snprintf(prompt, sizeof(prompt), - "Copied timezone file from %s to %s", zoneinfo_file, - path_localtime); - else - snprintf(prompt, sizeof(prompt), - "Created symbolic link from %s to %s", zoneinfo_file, - path_localtime); - if (usedialog) - dialog_msgbox(title, prompt, 8, 72, 1); - else - fprintf(stderr, "%s\n", prompt); + snprintf(title, sizeof(title), "Done"); + if (copymode) + snprintf(prompt, sizeof(prompt), + "Copied timezone file from %s to %s", + zoneinfo_file, path_localtime); + else + snprintf(prompt, sizeof(prompt), + "Created symbolic link from %s to %s", + zoneinfo_file, path_localtime); + if (usedialog) + dialog_msgbox(title, prompt, 8, 72, 1); + else + fprintf(stderr, "%s\n", prompt); #endif + } /* reallydoit */ return (DITEM_LEAVE_MENU); }