File:  [Apple XNU] / GNUtools / cc / make-support.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:45:38 2018 UTC (8 years, 2 months ago) by root
Branches: MAIN, Apple
CVS tags: HEAD, GNUtools33
GNU tools for NeXTSTEP 3.3


#include "make.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <mach/mach.h>
#include <servers/netname.h>
#include <sys/param.h>

void
make_support (type, name, file, line, msg, arg1, arg2, arg3)
      int type;
      char *name;
      char *file;
      int line;
      char *msg;
      int arg1;
      int arg2;
      int arg3;
{
  static port_t port = PORT_NULL;
  static int already_tried = 0;
  static char directory[MAXPATHLEN];
  char message[1000];
  
  if (port == PORT_NULL && already_tried == 0)
    {
      char *port_name = getenv ("MAKEPORT");
      char *host_name = getenv ("MAKEHOST");
      
      already_tried = 1;
      
      if (port_name == NULL)
        return;
      
      if (host_name == NULL)
        host_name = "";
      
      netname_look_up (name_server_port, host_name, port_name, &port);
      
      if (port == PORT_NULL)
	return;
      
      getwd (directory);
    }
  
  if (name == NULL)
    name = "";
  
  if (file == NULL)
    file = "";
  
  if (msg == NULL)
    message[0] = '\0';
  else
    sprintf (message, msg, arg1, arg2, arg3);
  
  make_alert (port,
	      type,
	      name, strlen (name) + 1,
	      file, strlen (file) + 1,
	      directory, strlen (directory) + 1,
	      line,
	      message, strlen (message) + 1);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.