Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 286102
Collapse All | Expand All

(-)a/configure.in (-1 / +1 lines)
Lines 952-958 AC_MSG_RESULT(unsigned $glib_size_type) Link Here
952
952
953
# Check for some functions
953
# Check for some functions
954
AC_CHECK_FUNCS(lstat strerror strsignal memmove vsnprintf stpcpy strcasecmp strncasecmp poll getcwd vasprintf setenv unsetenv getc_unlocked readlink symlink fdwalk)
954
AC_CHECK_FUNCS(lstat strerror strsignal memmove vsnprintf stpcpy strcasecmp strncasecmp poll getcwd vasprintf setenv unsetenv getc_unlocked readlink symlink fdwalk)
955
AC_CHECK_FUNCS(chown lchown fchmod fchown link statvfs statfs utimes getgrgid getpwuid)
955
AC_CHECK_FUNCS(chown lchmod lchown fchmod fchown link statvfs statfs utimes getgrgid getpwuid)
956
AC_CHECK_FUNCS(getmntent_r setmntent endmntent hasmntopt getmntinfo)
956
AC_CHECK_FUNCS(getmntent_r setmntent endmntent hasmntopt getmntinfo)
957
# Check for high-resolution sleep functions
957
# Check for high-resolution sleep functions
958
AC_CHECK_FUNCS(nanosleep nsleep)
958
AC_CHECK_FUNCS(nanosleep nsleep)
(-)a/gio/gcancellable.c (-4 / +4 lines)
Lines 495-504 g_cancellable_get_fd (GCancellable *cancellable) Link Here
495
 * readable status. Reading to unset the readable status is done
495
 * readable status. Reading to unset the readable status is done
496
 * with g_cancellable_reset().
496
 * with g_cancellable_reset().
497
 *
497
 *
498
 * @Returns: %TRUE if @pollfd was successfully initialized, %FALSE on 
498
 * Returns: %TRUE if @pollfd was successfully initialized, %FALSE on 
499
 *           failure to prepare the cancellable.
499
 *          failure to prepare the cancellable.
500
 * 
500
 * 
501
 * @Since: 2.22
501
 * Since: 2.22
502
 **/
502
 **/
503
gboolean
503
gboolean
504
g_cancellable_make_pollfd (GCancellable *cancellable, GPollFD *pollfd)
504
g_cancellable_make_pollfd (GCancellable *cancellable, GPollFD *pollfd)
Lines 558-564 g_cancellable_make_pollfd (GCancellable *cancellable, GPollFD *pollfd) Link Here
558
 * is not called. This can cause the application to run out of file 
558
 * is not called. This can cause the application to run out of file 
559
 * descriptors when many #GCancellables are used at the same time.
559
 * descriptors when many #GCancellables are used at the same time.
560
 * 
560
 * 
561
 * @Since: 2.22
561
 * Since: 2.22
562
 **/
562
 **/
563
void
563
void
564
g_cancellable_release_fd (GCancellable *cancellable)
564
g_cancellable_release_fd (GCancellable *cancellable)
(-)a/gio/glocalfileinfo.c (-4 / +29 lines)
Lines 1869-1883 get_string (const GFileAttributeValue *value, Link Here
1869
1869
1870
static gboolean
1870
static gboolean
1871
set_unix_mode (char                       *filename,
1871
set_unix_mode (char                       *filename,
1872
               GFileQueryInfoFlags         flags,
1872
	       const GFileAttributeValue  *value,
1873
	       const GFileAttributeValue  *value,
1873
	       GError                    **error)
1874
	       GError                    **error)
1874
{
1875
{
1875
  guint32 val;
1876
  guint32 val;
1877
  int res = 0;
1876
  
1878
  
1877
  if (!get_uint32 (value, &val, error))
1879
  if (!get_uint32 (value, &val, error))
1878
    return FALSE;
1880
    return FALSE;
1879
  
1881
1880
  if (g_chmod (filename, val) == -1)
1882
#ifdef HAVE_SYMLINK
1883
  if (flags & G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS) {
1884
#ifdef HAVE_LCHMOD
1885
    res = lchmod (filename, val);
1886
#else
1887
    struct stat statbuf;
1888
    /* Calling chmod on a symlink changes permissions on the symlink.
1889
     * We don't want to do this, so we need to check for a symlink */
1890
    res = g_lstat (filename, &statbuf);
1891
    if (res == 0 && S_ISLNK (statbuf.st_mode))
1892
      {
1893
        g_set_error_literal (error, G_IO_ERROR,
1894
                             G_IO_ERROR_NOT_SUPPORTED,
1895
                             _("Cannot set permissions on symlinks"));
1896
        return FALSE;
1897
      }
1898
    else if (res == 0)
1899
      res = g_chmod (filename, val);
1900
#endif
1901
  } else
1902
#endif
1903
    res = g_chmod (filename, val);
1904
1905
  if (res == -1)
1881
    {
1906
    {
1882
      int errsv = errno;
1907
      int errsv = errno;
1883
1908
Lines 2172-2178 _g_local_file_info_set_attribute (char *filename, Link Here
2172
  _g_file_attribute_value_set_from_pointer (&value, type, value_p, FALSE);
2197
  _g_file_attribute_value_set_from_pointer (&value, type, value_p, FALSE);
2173
  
2198
  
2174
  if (strcmp (attribute, G_FILE_ATTRIBUTE_UNIX_MODE) == 0)
2199
  if (strcmp (attribute, G_FILE_ATTRIBUTE_UNIX_MODE) == 0)
2175
    return set_unix_mode (filename, &value, error);
2200
    return set_unix_mode (filename, flags, &value, error);
2176
  
2201
  
2177
#ifdef HAVE_CHOWN
2202
#ifdef HAVE_CHOWN
2178
  else if (strcmp (attribute, G_FILE_ATTRIBUTE_UNIX_UID) == 0)
2203
  else if (strcmp (attribute, G_FILE_ATTRIBUTE_UNIX_UID) == 0)
Lines 2316-2322 _g_local_file_info_set_attributes (char *filename, Link Here
2316
  value = _g_file_info_get_attribute_value (info, G_FILE_ATTRIBUTE_UNIX_MODE);
2341
  value = _g_file_info_get_attribute_value (info, G_FILE_ATTRIBUTE_UNIX_MODE);
2317
  if (value)
2342
  if (value)
2318
    {
2343
    {
2319
      if (!set_unix_mode (filename, value, error))
2344
      if (!set_unix_mode (filename, flags, value, error))
2320
	{
2345
	{
2321
	  value->status = G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING;
2346
	  value->status = G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING;
2322
	  res = FALSE;
2347
	  res = FALSE;

Return to bug 286102