Changeset f54b07d
- Timestamp:
- Feb 26, 2011, 8:10:30 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 9620c8d
- Parents:
- cb6c9e1
- git-author:
- David Benjamin <davidben@mit.edu> (01/04/11 11:15:08)
- git-committer:
- David Benjamin <davidben@mit.edu> (02/26/11 20:10:30)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
global.c
r3472845 rf54b07d 9 9 #include "owl.h" 10 10 11 #ifndef MAXHOSTNAMELEN12 #define MAXHOSTNAMELEN 25613 #endif14 15 11 static void _owl_global_init_windows(owl_global *g); 16 12 17 13 void owl_global_init(owl_global *g) { 18 struct hostent *hent;19 char hostname[MAXHOSTNAMELEN];20 14 char *cd; 21 15 const char *homedir; 22 16 23 17 g_type_init(); 24 25 gethostname(hostname, MAXHOSTNAMELEN);26 hent=gethostbyname(hostname);27 if (!hent) {28 g->thishost=g_strdup("localhost");29 } else {30 g->thishost=g_strdup(hent->h_name);31 }32 18 33 19 g->lines=LINES; … … 497 483 time_t owl_global_get_idletime(const owl_global *g) { 498 484 return(time(NULL)-g->lastinputtime); 499 }500 501 const char *owl_global_get_hostname(const owl_global *g) {502 if (g->thishost) return(g->thishost);503 return("");504 485 } 505 486 -
message.c
r237d02c rf54b07d 960 960 void owl_message_create_from_zwrite(owl_message *m, const owl_zwrite *z, const char *body) 961 961 { 962 int ret;963 char hostbuff[5000];964 962 char *replyline; 965 963 … … 991 989 992 990 /* save the hostname */ 993 ret=gethostname(hostbuff, MAXHOSTNAMELEN); 994 hostbuff[MAXHOSTNAMELEN]='\0'; 995 if (ret) { 996 owl_message_set_hostname(m, "localhost"); 997 } else { 998 owl_message_set_hostname(m, hostbuff); 999 } 991 owl_message_set_hostname(m, g_get_host_name()); 1000 992 1001 993 /* set the "isprivate" attribute if it's a private zephyr. */ -
owl.h
r237d02c rf54b07d 594 594 int rightshift; 595 595 volatile sig_atomic_t resizepending; 596 char *thishost;597 596 char *homedir; 598 597 char *confdir; -
variable.c
rd4927a7 rf54b07d 466 466 int owl_variable_tty_set(owl_variable *v, const void *newval) 467 467 { 468 owl_zephyr_set_locationinfo( owl_global_get_hostname(&g), newval);468 owl_zephyr_set_locationinfo(g_get_host_name(), newval); 469 469 return(owl_variable_string_set_default(v, newval)); 470 470 }
Note: See TracChangeset
for help on using the changeset viewer.