diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2007-01-05 08:52:38 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2007-01-05 08:52:38 +0000 |
commit | 181b211e8430f46f51023a3e1792bc25bb69c695 (patch) | |
tree | a983836427479530992f89dd9967c62d977a21bc /usr.bin/cvs | |
parent | add52e2658e51e47efe20c01066ee96c70eab377 (diff) |
use correct hostname for notifications.
also, in a near future, might be worth thinking about sharing
some code between the edit and unedit commands, would shrink
the mess a little bit...
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/edit.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.bin/cvs/edit.c b/usr.bin/cvs/edit.c index 18a18fccf39..3e4d29e34f9 100644 --- a/usr.bin/cvs/edit.c +++ b/usr.bin/cvs/edit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: edit.c,v 1.18 2007/01/05 08:37:55 xsa Exp $ */ +/* $OpenBSD: edit.c,v 1.19 2007/01/05 08:52:37 xsa Exp $ */ /* * Copyright (c) 2006, 2007 Xavier Santolaria <xsa@openbsd.org> * @@ -244,7 +244,7 @@ cvs_edit_local(struct cvs_file *cf) FILE *fp; struct tm *t; time_t now; - char *bfpath, *fdate; + char *bfpath, *fdate, thishost[MAXHOSTNAMELEN]; if (cvs_noexec == 1) return; @@ -259,8 +259,11 @@ cvs_edit_local(struct cvs_file *cf) fdate = asctime(t); + if (gethostname(thishost, sizeof(thishost)) == -1) + fatal("gethostname failed"); + (void)fprintf(fp, "E%s\t%s GMT\t%s\t%s\t\n", - cf->file_name, fdate, current_cvsroot->cr_host, cf->file_wd); + cf->file_name, fdate, thishost, cf->file_wd); if (edit_aflags & E_EDIT) (void)fprintf(fp, "E"); @@ -300,7 +303,7 @@ cvs_unedit_local(struct cvs_file *cf) struct stat st; struct tm *t; time_t now; - char *bfpath, *fdate; + char *bfpath, *fdate, thishost[MAXHOSTNAMELEN]; if (cvs_noexec == 1) return; @@ -338,8 +341,11 @@ cvs_unedit_local(struct cvs_file *cf) fdate = asctime(t); + if (gethostname(thishost, sizeof(thishost)) == -1) + fatal("gethostname failed"); + (void)fprintf(fp, "U%s\t%s GMT\t%s\t%s\t\n", - cf->file_name, fdate, current_cvsroot->cr_host, cf->file_wd); + cf->file_name, fdate, thishost, cf->file_wd); (void)fclose(fp); |