monotone

monotone Mtn Source Tree

Root/unix/os_strerror.cc

1// Copyright (C) 2006 Matthew Gregan <kinetik@.orcon.net.nz>
2// all rights reserved.
3// licensed to the public under the terms of the GNU GPL (>= 2)
4// see the file COPYING for details
5
6#include "base.hh"
7#include <string.h>
8
9#include "sanity.hh"
10#include "platform.hh"
11
12std::string
13os_strerror(os_err_t errnum)
14{
15 char* msg = strerror(errnum);
16 if (msg == 0)
17 return (F("unknown error code %d") % errnum).str();
18 return std::string(msg);
19}
20
21// Local Variables:
22// mode: C++
23// fill-column: 76
24// c-file-style: "gnu"
25// indent-tabs-mode: nil
26// End:
27// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status