[haiku-commits] haiku: hrev52263 - data/etc src/system/kernel/fs

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 21 Aug 2018 21:25:43 -0400 (EDT)

hrev52263 adds 2 changesets to branch 'master'
old head: d37ae8656890f523b97293f026c4246f7d723b45
new head: 0217e08a6355a03013f9609a6fa65fdab5e3eb41
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=0217e08a6355+%5Ed37ae8656890

----------------------------------------------------------------------------

9d1582e31ace: etc/profile: Add kallisti5's smiley-face $? indicator and use $ 
not >.
  
  An example of the new prompt line format is:
  
  ~/Desktop/haiku :) $
  
  Or if the last command exited in failure:
  
  ~/Desktop/haiku :( $
  
  The smiley-face will be either dark green or red, also depending on
  the command status.
  
  I realize this could be a tad controversial, especially for those used
  to the old prompt, but it seems to be a pretty useful feature to me
  (and of course kallisti5 came up with it.) But if the bikeshed turns
  out to be too large, we can revert it and deal with it after the beta.
  
  As for $ vs > -- BeOS R5 used $, most modern Linux uses $, and having >
  come after a space looks much stranger.

0217e08a6355: vfs: panic() if volume->ops is NULL but status == B_OK.
  
  This panic, unlike the NULL dereference that would otherwise occur, is
  at least continuable.

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

2 files changed, 8 insertions(+), 3 deletions(-)
data/etc/profile             | 9 ++++++---
src/system/kernel/fs/vfs.cpp | 2 ++

############################################################################

Commit:      9d1582e31ace462d2254ff8b10d0a234989b03a9
URL:         https://git.haiku-os.org/haiku/commit/?id=9d1582e31ace
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Wed Aug 22 01:01:20 2018 UTC

etc/profile: Add kallisti5's smiley-face $? indicator and use $ not >.

An example of the new prompt line format is:

~/Desktop/haiku :) $

Or if the last command exited in failure:

~/Desktop/haiku :( $

The smiley-face will be either dark green or red, also depending on
the command status.

I realize this could be a tad controversial, especially for those used
to the old prompt, but it seems to be a pretty useful feature to me
(and of course kallisti5 came up with it.) But if the bikeshed turns
out to be too large, we can revert it and deal with it after the beta.

As for $ vs > -- BeOS R5 used $, most modern Linux uses $, and having >
come after a space looks much stranger.

----------------------------------------------------------------------------

diff --git a/data/etc/profile b/data/etc/profile
index 423dfd6a02..5885d01eb0 100644
--- a/data/etc/profile
+++ b/data/etc/profile
@@ -1,18 +1,21 @@
 #
 # Administrative startup for /bin/sh
-# Place user customizations in /.profile
+# Place user customizations in ~/config/settings/profile
 #
 
 ARCH=`getarch 2>/dev/null`
 if [ "$ARCH" = "`getarch -p 2>/dev/null`" ] ; then
        echo -e "\nWelcome to the Haiku shell.\n"
-       export PS1="\w> "
+       PS1="\w "
 else
        echo -e "\nSwitching to architecture `getarch`\n"
-       export PS1="[$ARCH] \w> "
+       PS1="[$ARCH] \w "
 fi
 unset ARCH
 
+PS1="$PS1"'`if [ $? = 0 ]; then echo "\e[32m:)\e[0m\]";        else \
+       echo "\e[31;1m\]:(\e[0m\]"; fi` \e[0m\]$ '
+
 export USER=`id -un`
 export GROUP=`id -gn`
 

############################################################################

Revision:    hrev52263
Commit:      0217e08a6355a03013f9609a6fa65fdab5e3eb41
URL:         https://git.haiku-os.org/haiku/commit/?id=0217e08a6355
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Wed Aug 22 01:22:52 2018 UTC

vfs: panic() if volume->ops is NULL but status == B_OK.

This panic, unlike the NULL dereference that would otherwise occur, is
at least continuable.

----------------------------------------------------------------------------

diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp
index 3b3c6bb7a5..a15c73e7eb 100644
--- a/src/system/kernel/fs/vfs.cpp
+++ b/src/system/kernel/fs/vfs.cpp
@@ -7524,6 +7524,8 @@ fs_mount(char* path, const char* device, const char* 
fsName, uint32 flags,
                        status = volume->file_system->mount(volume, device, 
flags, args,
                                &rootID);
                        if (status != B_OK || volume->ops == NULL) {
+                               if (status == B_OK && volume->ops == NULL)
+                                       panic("fs_mount: mount() succeeded but 
ops is NULL!");
                                if (volume->sub_volume)
                                        goto err4;
                                goto err3;


Other related posts: