]> git.cameronkatri.com Git - pw-darwin.git/blobdiff - pw/pw_log.c
Rework the home directory creation and copy or the skel content to use *at
[pw-darwin.git] / pw / pw_log.c
index 7a4ae9b26f94c857ab24e8d783880a6a467fc267..b7744234c3363d30aa71d3094209a33ae15aec60 100644 (file)
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- *     $Id$
  */
 
+#ifndef lint
+static const char rcsid[] =
+  "$FreeBSD$";
+#endif /* not lint */
+
 #include <fcntl.h>
 
 #include "pw.h"
@@ -44,16 +47,15 @@ pw_log(struct userconf * cnf, int mode, int which, char const * fmt,...)
                }
                if (logfile != NULL) {
                        va_list         argp;
-                       int             l;
                        time_t          now = time(NULL);
                        struct tm      *t = localtime(&now);
                        char            nfmt[256];
-                       char           *name;
+                       const char     *name;
 
                        if ((name = getenv("LOGNAME")) == NULL && (name = getenv("USER")) == NULL)
                                name = "unknown";
-                       strftime(nfmt, sizeof nfmt, "%d-%b-%Y %R ", t);
-                       l = strlen(nfmt);
+                       /* ISO 8601 International Standard Date format */
+                       strftime(nfmt, sizeof nfmt, "%Y-%m-%d %T ", t);
                        sprintf(nfmt + strlen(nfmt), "[%s:%s%s] %s\n", name, Which[which], Modes[mode], fmt);
                        va_start(argp, fmt);
                        vfprintf(logfile, nfmt, argp);