diff options
author | Dave Brolley <brolley@redhat.com> | 2009-06-11 11:58:55 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-06-11 11:58:55 -0400 |
commit | b12c8986778619db5bec0a5e52f2d49247e6b5ba (patch) | |
tree | b5136adab377bb897ca7d132b1807487c19d61db /util.cxx | |
parent | 36b66efaae572dddcfb04e9a995ca69063d0e1ff (diff) | |
download | systemtap-steved-b12c8986778619db5bec0a5e52f2d49247e6b5ba.tar.gz systemtap-steved-b12c8986778619db5bec0a5e52f2d49247e6b5ba.tar.xz systemtap-steved-b12c8986778619db5bec0a5e52f2d49247e6b5ba.zip |
Only sign modules if --unprivileged is specified.
Don't generate an error message for unsigned modules.
Make sure module signature exists before attempting to copy to the cache.
Allow timer p[robes for unprivileged users.
Diffstat (limited to 'util.cxx')
-rw-r--r-- | util.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -51,6 +51,30 @@ get_home_directory(void) } +// Get the size of a file in bytes +size_t +get_file_size(const string &path) +{ + struct stat file_info; + + if (stat(path.c_str(), &file_info) == 0) + return file_info.st_size; + else + return 0; +} + +// Get the size of a file in bytes +bool +file_exists (const string &path) +{ + struct stat file_info; + + if (stat(path.c_str(), &file_info) == 0) + return true; + + return false; +} + // Copy a file. The copy is done via a temporary file and atomic // rename. int |