home *** CD-ROM | disk | FTP | other *** search
/ ftp.parl.clemson.edu / 2015-02-07.ftp.parl.clemson.edu.tar / ftp.parl.clemson.edu / pub / pvfs2 / orangefs-2.8.3-20110323.tar.gz / orangefs-2.8.3-20110323.tar / orangefs / src / client / sysint / error-details.c < prev    next >
C/C++ Source or Header  |  2004-07-28  |  1KB  |  54 lines

  1. /*
  2.  * (C) 2004 Clemson University and The University of Chicago
  3.  *
  4.  * See COPYING in top-level directory.
  5.  */
  6.  
  7. #include <stdlib.h>
  8.  
  9. #include "pvfs2-types.h"
  10.  
  11. /* PVFS2 error details functions
  12.  *
  13.  * The error details system is used for returning server-specific errors
  14.  * for cases where one or more errors have occurred when talking to
  15.  * a collection of servers.
  16.  *
  17.  * The PVFS_error_details structure is defined in pvfs2-types.h.
  18.  */
  19.  
  20. /* PVFS_error_details_new(count)
  21.  *
  22.  * Q: SHOULD WE RETURN AN INTEGER ERROR INSTEAD?
  23.  */
  24. PVFS_error_details *PVFS_error_details_new(int count)
  25. {
  26.     PVFS_error_details *details;
  27.     int sz;
  28.  
  29.     sz = sizeof(PVFS_error_details) +
  30.     (count-1) * sizeof(PVFS_error_server);
  31.  
  32.     details = (PVFS_error_details *) malloc(sz);
  33.     if (details != NULL)
  34.     {
  35.     details->count_allocated = count;
  36.     }
  37.  
  38.     return details;
  39. }
  40.  
  41. void PVFS_error_details_free(PVFS_error_details *details)
  42. {
  43.     free(details);
  44. }
  45.  
  46. /*
  47.  * Local variables:
  48.  *  c-indent-level: 4
  49.  *  c-basic-offset: 4
  50.  * End:
  51.  *
  52.  * vim: ts=8 sts=4 sw=4 expandtab
  53.  */
  54.