all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: tromey@redhat.com
Cc: Andreas Schwab <schwab@suse.de>, emacs-devel@gnu.org
Subject: Re: cvs emacs and (system-name)
Date: Tue, 17 Apr 2007 15:45:57 -0400	[thread overview]
Message-ID: <87ps62kcne.fsf@stupidchicken.com> (raw)
In-Reply-To: <m3mz164yys.fsf@localhost.localdomain> (Tom Tromey's message of "17 Apr 2007 12\:50\:35 -0600")

Tom Tromey <tromey@redhat.com> writes:

>>>>>> "Andreas" == Andreas Schwab <schwab@suse.de> writes:
>
>>> However, 'hostname' on this machine reports 'opsy'.
>
> Andreas> What does hostname -f give you?
>
> opsy. hostname -f
> opsy

Could you try to compile the following program and report its output?


#include <stdio.h>
#include <alloca.h>
#include <string.h>
#include <sys/socket.h>
#include <netdb.h>

int main ()
{
  int hostname_size = 256;
  char *hostname = (char *) alloca (hostname_size);

  while (1)
    {
      gethostname (hostname, hostname_size - 1);
      hostname[hostname_size - 1] = '\0';
      if (strlen (hostname) < hostname_size - 1)
	break;
      hostname_size <<= 1;
      hostname = (char *) alloca (hostname_size);
    }

  if (! index (hostname, '.'))
    {
      struct hostent *hp;
      hp = gethostbyname (hostname);
      if (hp)
	{
	  char *fqdn = (char *) hp->h_name;
	  if (!index (fqdn, '.'))
	    {
	      char **alias = hp->h_aliases;
	      while (*alias && !index (*alias, '.'))
		alias++;
	      if (*alias)
		fqdn = *alias;
	    }
	  hostname = fqdn;
	}
    }
  printf ("%s\n", hostname);
}

  reply	other threads:[~2007-04-17 19:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-17 18:31 cvs emacs and (system-name) Tom Tromey
2007-04-17 19:05 ` Andreas Schwab
2007-04-17 18:50   ` Tom Tromey
2007-04-17 19:45     ` Chong Yidong [this message]
2007-04-17 19:30       ` Tom Tromey
2007-04-18 14:55         ` Richard Stallman
2007-04-18 17:17           ` Glenn Morris
2007-04-18 21:40             ` Tom Tromey
2007-04-19  5:00               ` Glenn Morris
2007-04-19 16:14                 ` Stefan Monnier
2007-04-19 18:25                   ` Tom Tromey
2007-04-19 18:48                     ` Chong Yidong
2007-04-19 21:25                     ` Stefan Monnier
2007-04-19 21:23                 ` Stefan Monnier
2007-04-19 21:30                   ` Chong Yidong
2007-04-19 21:31                     ` Glenn Morris
2007-04-20 14:52                   ` Richard Stallman
2007-04-20 21:39                     ` Chong Yidong
2007-04-19 23:17                 ` Richard Stallman
2007-04-20  1:27                   ` Glenn Morris
2007-04-19 13:42             ` Richard Stallman
2007-04-19 17:05               ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ps62kcne.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@suse.de \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.