home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / lib / Xau / AuUnlock.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-17  |  1.5 KB  |  53 lines

  1. /*
  2.  * Xau - X Authorization Database Library
  3.  *
  4.  * $XConsortium: AuUnlock.c,v 1.5 91/04/17 11:00:11 rws Exp $
  5.  *
  6.  * Copyright 1988 Massachusetts Institute of Technology
  7.  *
  8.  * Permission to use, copy, modify, and distribute this software and its
  9.  * documentation for any purpose and without fee is hereby granted, provided
  10.  * that the above copyright notice appear in all copies and that both that
  11.  * copyright notice and this permission notice appear in supporting
  12.  * documentation, and that the name of M.I.T. not be used in advertising or
  13.  * publicity pertaining to distribution of the software without specific,
  14.  * written prior permission.  M.I.T. makes no representations about the
  15.  * suitability of this software for any purpose.  It is provided "as is"
  16.  * without express or implied warranty.
  17.  *
  18.  * Author:  Keith Packard, MIT X Consortium
  19.  */
  20.  
  21. #include <X11/Xauth.h>
  22. #include <sys/types.h>
  23. #include <sys/stat.h>
  24. #ifndef X_NOT_POSIX
  25. #include <errno.h>
  26. #else
  27. #include <sys/errno.h>
  28. #endif
  29.  
  30. #if NeedFunctionPrototypes
  31. XauUnlockAuth (
  32. _Xconst char *file_name)
  33. #else
  34. XauUnlockAuth (file_name)
  35. char    *file_name;
  36. #endif
  37. {
  38.     char    creat_name[1025], link_name[1025];
  39.     char    *strcpy (), *strcat ();
  40.  
  41.     if (strlen (file_name) > 1022)
  42.     return;
  43.     (void) strcpy (creat_name, file_name);
  44.     (void) strcat (creat_name, "-c");
  45.     (void) strcpy (link_name, file_name);
  46.     (void) strcat (link_name, "-l");
  47.     /*
  48.      * I think this is the correct order
  49.      */
  50.     (void) unlink (creat_name);
  51.     (void) unlink (link_name);
  52. }
  53.